[{"data":1,"prerenderedAt":112},["ShallowReactive",2],{"doc:\u002Fdocs\u002Fsdks\u002Fnuxt":3},{"page":4,"toc":105,"updated":111},{"path":5,"title":6,"seoTitle":7,"description":8,"blocks":9},"\u002Fdocs\u002Fsdks\u002Fnuxt","Nuxt","Nuxt Module: Auto-imported Composables","A Nuxt module for Nuxt 3 and 4. Configure the key in nuxt.config or the environment, then use auto-imported composables in any component.",[10,13,18,31,34,40,42,47,77,81,84,90,92,95,97,100],{"type":11,"text":12},"p","`@fingerly\u002Fnuxt` registers the [Vue plugin](\u002Fdocs\u002Fsdks\u002Fvue) and auto-imports `useIdentify`, `useVerdict` and `useFingerly`.",{"type":14,"level":15,"text":16,"id":17},"heading",2,"Install","install",{"type":19,"samples":20},"code",[21,25,28],{"label":22,"lang":23,"code":24},"npm","bash","npm install @fingerly\u002Fnuxt",{"label":26,"lang":23,"code":27},"pnpm","pnpm add @fingerly\u002Fnuxt",{"label":29,"lang":23,"code":30},"yarn","yarn add @fingerly\u002Fnuxt",{"type":14,"level":15,"text":32,"id":33},"Configure","configure",{"type":19,"samples":35},[36],{"label":37,"lang":38,"code":39},"nuxt.config.ts","ts","export default defineNuxtConfig({\n  modules: ['@fingerly\u002Fnuxt'],\n  fingerly: {\n    apiKey: 'fly_pk_us_development_…',\n  },\n})",{"type":11,"text":41},"The options are published to `runtimeConfig.public.fingerly`, so each one can be overridden per environment without a rebuild:",{"type":19,"samples":43},[44],{"label":45,"lang":23,"code":46},".env","NUXT_PUBLIC_FINGERLY_API_KEY=fly_pk_us_production_…\nNUXT_PUBLIC_FINGERLY_ENDPOINT=\nNUXT_PUBLIC_FINGERLY_SUBMIT=true\nNUXT_PUBLIC_FINGERLY_CONSENT=granted",{"type":48,"title":49,"fields":50},"fields","Module options",[51,56,59,63,68,72],{"name":52,"type":53,"text":54,"required":55},"apiKey","string","Your public key.",true,{"name":57,"type":53,"text":58},"endpoint","A single API origin or first-party path.",{"name":60,"type":61,"text":62},"endpoints","string[]","Ordered first-party endpoints. Set `endpoint` or `endpoints`, not both.",{"name":64,"type":65,"text":66,"default":67},"fallbackToDefaultEndpoint","boolean","Try the regional API after your own endpoints fail.","false",{"name":69,"type":65,"text":70,"default":71},"submit","Set `false` to collect without sending.","true",{"name":73,"type":74,"text":75,"default":76},"consent","'granted' | 'pending' | 'denied'","The starting [consent state](\u002Fdocs\u002Fprivacy-and-consent#consent). Change it at runtime with `setConsent()` from `useFingerly()`.","'granted'",{"type":78,"tone":79,"text":80},"callout","tip","Without a key the module warns once in the console and identification fails until one is set.",{"type":14,"level":15,"text":82,"id":83},"Use it","use-it",{"type":19,"samples":85},[86],{"label":87,"lang":88,"code":89},"components\u002FSignupForm.vue","vue","\u003Cscript setup lang=\"ts\">\nconst { identify, isLoading } = useIdentify({ tag: 'signup' })\n\nasync function onSubmit(form: { email: string }) {\n  const { requestId } = await identify()\n  await $fetch('\u002Fapi\u002Fsignup', { method: 'POST', body: { ...form, requestId } })\n}\n\u003C\u002Fscript>",{"type":11,"text":91},"The composables are the Vue SDK's, unchanged. See [useIdentify](\u002Fdocs\u002Fsdks\u002Fvue#useidentify) and [useVerdict](\u002Fdocs\u002Fsdks\u002Fvue#useverdict).",{"type":14,"level":15,"text":93,"id":94},"Server rendering","server-rendering",{"type":11,"text":96},"The plugin is registered on both server and client, so the composables work in any component during server rendering, where they return the unidentified state. Identification itself only happens in the browser.",{"type":14,"level":15,"text":98,"id":99},"Verify in a server route","verify-in-a-server-route",{"type":19,"samples":101},[102],{"label":103,"lang":38,"code":104},"server\u002Fapi\u002Fsignup.post.ts","import { load } from '@fingerly\u002Fnode'\n\nconst fingerly = load({ secretKey: process.env.FINGERLY_SECRET_KEY! })\n\nexport default defineEventHandler(async (event) => {\n  const { email, requestId } = await readBody(event)\n  const result = await fingerly.events.get(requestId)\n  if (result.tag !== 'signup') throw createError({ statusCode: 400 })\n  \u002F\u002F decide with result.suspect_level\n})",[106,107,108,109,110],{"id":17,"text":16,"level":15},{"id":33,"text":32,"level":15},{"id":83,"text":82,"level":15},{"id":94,"text":93,"level":15},{"id":99,"text":98,"level":15},"2026-09-17T16:57:29.000Z",1789667797803]