Skip to content

Commit de304f3

Browse files
committed
feat: mava script and user attribute
1 parent b6b7c17 commit de304f3

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

web/src/context/AtlasProvider.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,15 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) =
133133
queryFn: async () => {
134134
try {
135135
if (!isVerified || isUndefined(address)) return undefined;
136-
return await fetchUser(atlasGqlClient);
136+
const user = await fetchUser(atlasGqlClient);
137+
138+
if (user?.email && window.Mava) {
139+
window.Mava.initialize();
140+
window.Mava.identify({ emailAddress: user.email });
141+
window.Mava.identify({ customAttributes: [{ label: "Wallet Address", value: address }] });
142+
}
143+
144+
return user;
137145
} catch {
138146
return undefined;
139147
}

web/src/index.html

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@
77
name="description"
88
content="Kleros is a decentralized, blockchain-based dispute resolution platform that offers fast and affordable arbitration for various type of dispute. Join the future of dispute resolution with Kleros Court."
99
/>
10-
<meta
11-
name="keywords"
12-
content="dispute resolution, decentralized arbitration, Kleros, blockchain court"
13-
/>
10+
<meta name="keywords" content="dispute resolution, decentralized arbitration, Kleros, blockchain court" />
1411
<link rel="shortcut icon" type="image/svg+xml" href="./favicon.ico" />
1512
<title>Kleros · Court</title>
13+
<script
14+
defer
15+
src="https://widget.mava.app"
16+
widget-version="v2"
17+
id="MavaWebChat"
18+
enable-sdk="true"
19+
data-token="1fea31aa0b93836faca36269f324468e08cc26f0298f8d8e6c5b089d0d58eb1c"
20+
></script>
1621
</head>
1722
<body>
1823
<div id="app"></div>

0 commit comments

Comments
 (0)