A Vue app talks to your API from the browser, which is exactly where automated signups and credential stuffing come from. Adding device intelligence gives every request a stable visitor ID and a confidence score so you can tell a returning human from a script pretending to be one.
This guide wires Prynt into Vue 3 the idiomatic way: initialize the agent once, expose it through the Composition API, and verify results on your server before you trust them.
Load the agent once as a plugin
The agent should initialize a single time for the whole app. A tiny plugin loads Prynt’s browser agent from the CDN and puts it behind provide/inject so any component can reach it without re-loading.
Packages: Prynt’s npm package is coming. Until then, use the CDN script and the plain REST calls below; they work today.
// prynt.js: loads Prynt's browser agent from the CDN once and provides it to the app.
import { ref } from 'vue'
let loading
export function getPrynt() {
loading ??= new Promise((resolve, reject) => {
const s = document.createElement('script')
s.src = 'https://api.pryntid.com/cdn/prynt.umd.js'
s.async = true
s.onload = () => resolve(window.Prynt.load({
apiKey: import.meta.env.VITE_PRYNT_KEY, // your public key
endpoint: 'https://api.pryntid.com',
extendedResult: true
}))
s.onerror = () => { loading = undefined; reject(new Error('Prynt agent failed to load')) }
document.head.appendChild(s)
})
return loading
}
export const pryntPlugin = {
install(app) {
const agent = ref(null)
app.provide('prynt', agent) // provide first; the ref fills in once loaded
getPrynt().then((a) => { agent.value = a }).catch(() => {})
}
}
Register it in main.js with app.use(pryntPlugin). Loading is asynchronous and off the render path, so it never blocks first paint.
Identify at the moments that matter
Do not fingerprint on every route change. Call identify() at decision points: submitting a login, opening checkout, or creating an account. A small composable keeps that logic reusable.
// usePrynt.js
import { inject } from 'vue'
export function usePrynt() {
const agent = inject('prynt')
async function identify() {
if (!agent.value) return null
const result = await agent.value.identify({ tag: { action: 'login' } })
return result.requestId // send this to your backend
}
return { identify }
}
In a login component you call identify() on submit and pass the requestId alongside the credentials. The browser never decides anything on its own; it only collects the signal.
Verify the event on your server
The confidence score and visitor ID matter only after your backend confirms them. Never trust the raw client value. Look the event up with your secret key.
// POST /login handler (Node example)
const res = await fetch(
`https://api.pryntid.com/v1/events/${encodeURIComponent(requestId)}`,
{ headers: { Authorization: `Bearer ${process.env.PRYNT_SECRET_KEY}` } }
)
if (!res.ok) return reply.code(400).send({ error: 'unknown device event' }) // 404 = unknown requestId
const event = await res.json()
if (event.confidence.score < 0.5 || event.smartSignals?.bot?.result) {
return reply.code(403).send({ error: 'blocked' })
}
Now the visitor ID is trustworthy: it came from Prynt, not from a field a script can forge. Store it against the account so you can spot the same device creating ten “different” users. The full field list lives in the server-side verification docs.
Protect forms directly
For contact, signup, or login forms you can skip most of the wiring and let Form Shield guard the element. It watches submission behavior and adds signals for scripted fills.
import { onMounted } from 'vue'
import { getPrynt } from './prynt.js'
onMounted(async () => {
const form = document.querySelector('#signup')
const agent = await getPrynt() // same loaded agent; waits if it is still loading
agent.protectForm(form, {
autoGuard: true,
expectedScripts: ['latin']
})
})
The expectedScripts option flags submissions in unexpected writing systems, a cheap and effective spam signal for Latin-script audiences. See the form protection overview for the tuning options.
Wire signals into your flows
With verification in place, use the score to branch instead of block outright. Low-confidence logins get a step-up challenge; clean checkouts pass straight through. Store the visitor ID and IP intelligence with each event so your fraud rules can query history rather than react in the moment.
Because Prynt runs as a managed cloud service, you get geolocation and ASN data, proxy and VPN flags, and bot detection without maintaining any of that yourself. The free tier covers early traffic, so you can validate the integration before you pay for anything.
Start with the free plan and pricing details, drop the plugin into your Vue app, and you will have trustworthy device signals flowing into your backend within an afternoon.
Try it free
Prynt is device intelligence with a free plan: 5,000 identifications a month, visitor IDs with confidence and bot detection — no credit card. Upgrade to Pro for VPN, proxy, tampering and behavioral signals.