Install by framework
One self-contained install page per framework: Next.js, React (Vite), Vue and Nuxt, SvelteKit, Astro, plain HTML and server Node.
Pick your framework. Each page covers the same steps in the same order: install the npm package, init with the project key, the CSP lines, the optional reverse proxy, consent, and how to check that the first event arrived.
Framework | Page |
|---|---|
Next.js (App Router) | |
React with Vite | |
Vue 3 and Nuxt | |
SvelteKit | |
Astro | |
Plain HTML, no build step | |
Node.js on the server | |
Expo (iOS and Android) | |
Browser extension (Chrome, Edge, Firefox) |
Other languages and mobile SDKs are in Install an SDK. Site builders such as Webflow, Wix and Squarespace use the plain-HTML snippet: see site builders.
What every browser page shares
Use the public key (
lc_pk_...) in browser code. The secret key (lc_sk_...) is for servers only. Both are in Settings > Project > Keys; see the quickstart.Init needs only the key. The default capture host is
https://capture.lucidace.com, so no host option is needed on the cloud. SetapiHostonly when you self-host Lucida or send through a reverse proxy on your own domain (Serve Lucida from your own domain).ESM import is the default. The classic
<script>snippet with the globallucidaQueueis for sites with no build step, and has its own page.Consent default. An undecided visitor is tracked unless you start in
opt_in. See Consent by location.Detail pages: Content Security Policy, Serve Lucida from your own domain, SDK pinning, Browser extension, Sending data.
You can also let the CLI write the init file: lucida init --framework <id> with next, react, vue, nuxt, sveltekit, astro, react-native, expo, wxt, plasmo, chrome-extension or node (the CLI). html prints the classic snippet instead.