Spoar

Frameworks

Which parts of the SDK each stack uses, with a setup page per stack.

The browser core has no framework dependency, so any stack that bundles ES modules can use it. Next.js and React get dedicated entries; the other stacks use the core and plugins directly.

StackWhat you usePage
Next.js 15 or laterThe core, /react, /next, /proxy and /serverNext.js
React 19 with any router, ViteThe core and /reactReact
Plain TypeScript or JavaScript with a bundlerThe core and pluginsVanilla
Vue with Vite or another bundlerThe core and pluginsVue
Svelte and SvelteKitThe core and pluginsSvelte
AstroThe core and plugins in a client script, /proxy and /server in endpointsAstro
Node, Bun, Deno, Vercel Functions, Cloudflare Workers, other languages/server and /proxy, or POST /v2/eventsServer

What every setup has in common

  1. A project with two keys: the public key (pk_...) goes to the browser, the secret key (sk_...) stays in server environment variables. Quick start creates both.
  2. An events.ts type that lists your custom events once, shared by the browser and server clients. See Concepts.
  3. One client created with createAnalytics in its own module and imported wherever you track. It starts itself only where window exists, so importing it during server rendering sends nothing.
  4. Where you have a server, a same-origin path such as /_ra served by createProxy, so ad blockers see a first-party request. See Proxy.

On this page