Place the following script in your _app.tsx, at the bottom of your return statement
<Script
src="<https://cdn.jsdelivr.net/gh/qualli-research-platform/qualli-js-sdk/build/index.browser.min.js>"
onLoad={() => {
// @ts-ignore
Qualli.init('YOUR_API_KEY', {
trackScreens: false, // for Single-page-apps recommended to use triggers
});
}}
/>
Your Api Key can be found on our platform. Navigate to “settings” → “API Keys” (guide here)
The Qualli object gets injected in your window, and will be available anywhere in your code.
// Set User Attributes
useEffect(() => {
Qualli.setAttributes({
email: 'USER_EMAIL',
company_identifier: 'USER_EMAIL', // to identify your unique company user
});
}, []);
// perform a trigger
Qualli.performTrigger('APP_ONBOARDING_COMPLETED');
For a detailed look at the available methods, please have a look at this page