Overview
Pick the MIRA FIVE SDK for your stack, from a script tag to framework packages for React, Next.js, Nuxt, Astro, Laravel and more.
Pick the package for the framework you use. Framework packages wire the browser and server SDKs for you (they install as peer dependencies), so you set up one package and get pageviews, events, feature flags and server-side tracking the way that framework expects.
Which one
| You have | Use | Runs in |
|---|---|---|
| Any website, no build step (WordPress, Webflow, static HTML) | Script tag | Browser |
| A bundled frontend without a framework package | Browser | Browser |
| React (Vite, React Router, CRA) | React | Browser |
| Next.js | Next.js | Browser and server |
| TanStack Start | TanStack Start | Browser and server |
| Vue 3 | Vue | Browser |
| Nuxt | Nuxt | Browser and server |
| Astro | Astro | Browser and server |
| Node.js, Bun, Deno, Cloudflare Workers, Vercel functions | Node.js and edge | Server |
| Convex | Convex | Server |
| PHP | PHP | Server |
| Laravel | Laravel | Server, plus the script tag |
| Symfony | Symfony | Server, plus the script tag |
| Anything else | Ingest API over HTTP | Anywhere |
What every SDK shares
- One wire format. Every package sends the same JSON batch to
https://events.mirafive.io. You can mix them: a Laravel backend and a React frontend report into the same project. - Two keys, never swapped. Browser code uses the public website key. Server code uses the secret key. Browser SDKs refuse a secret key, and MIRA FIVE marks a secret key sent from a browser as exposed. See Keys.
- Consentless by default in the browser. No cookies, no storage, no ids, no banner needed. Switch to full mode to identify users behind a consent manager. See Consent.
- Nothing throws for network reasons. Browser SDKs drop a failed batch and warn once in development. Server SDKs report through an error callback and a typed
MiraError. - The same environment variables.
MIRAFIVE_WEBSITE_KEY,MIRAFIVE_SECRET_KEYandMIRAFIVE_HOST, plus the framework's public prefix for the website key:NEXT_PUBLIC_MIRAFIVE_KEY,VITE_MIRAFIVE_KEY,PUBLIC_MIRAFIVE_KEYorNUXT_PUBLIC_MIRAFIVE_KEY.
Packages
| Package | Registry |
|---|---|
@mirafive/tracker | npm, and hosted at https://cdn.mirafive.io/mira.js |
@mirafive/sdk-browser | npm |
@mirafive/sdk-react | npm |
@mirafive/sdk-next | npm |
@mirafive/sdk-tanstack | npm |
@mirafive/sdk-vue | npm |
@mirafive/sdk-nuxt | npm |
@mirafive/sdk-astro | npm |
@mirafive/sdk-server | npm |
@mirafive/sdk-convex | npm |
mirafive/sdk-php | Packagist |
mirafive/sdk-laravel | Packagist |
mirafive/sdk-symfony | Packagist |
All JavaScript packages are ESM only and ship TypeScript types. All packages are MIT licensed.