Set up HumanBehavior SDK with Svelte applications
.env
) with your API key:
VITE_
to be accessible in the browser.+layout.svelte
file:
browser
check prevents the tracker from initializing during server-side rendering, which would cause errors since browser APIs aren’t available on the server.main.js
or main.ts
file:
VITE_
browser
check to avoid SSR issues.env
is in your project root directory