MIRA FIVE

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 haveUseRuns in
Any website, no build step (WordPress, Webflow, static HTML)Script tagBrowser
A bundled frontend without a framework packageBrowserBrowser
React (Vite, React Router, CRA)ReactBrowser
Next.jsNext.jsBrowser and server
TanStack StartTanStack StartBrowser and server
Vue 3VueBrowser
NuxtNuxtBrowser and server
AstroAstroBrowser and server
Node.js, Bun, Deno, Cloudflare Workers, Vercel functionsNode.js and edgeServer
ConvexConvexServer
PHPPHPServer
LaravelLaravelServer, plus the script tag
SymfonySymfonyServer, plus the script tag
Anything elseIngest API over HTTPAnywhere

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_KEY and MIRAFIVE_HOST, plus the framework's public prefix for the website key: NEXT_PUBLIC_MIRAFIVE_KEY, VITE_MIRAFIVE_KEY, PUBLIC_MIRAFIVE_KEY or NUXT_PUBLIC_MIRAFIVE_KEY.

Packages

PackageRegistry
@mirafive/trackernpm, and hosted at https://cdn.mirafive.io/mira.js
@mirafive/sdk-browsernpm
@mirafive/sdk-reactnpm
@mirafive/sdk-nextnpm
@mirafive/sdk-tanstacknpm
@mirafive/sdk-vuenpm
@mirafive/sdk-nuxtnpm
@mirafive/sdk-astronpm
@mirafive/sdk-servernpm
@mirafive/sdk-convexnpm
mirafive/sdk-phpPackagist
mirafive/sdk-laravelPackagist
mirafive/sdk-symfonyPackagist

All JavaScript packages are ESM only and ship TypeScript types. All packages are MIT licensed.

On this page