vyget() reads the result of a verification straight off the current URL. When the hosted flow sends a user back to your page, it appends the outcome as query parameters; vyget() parses them for you so you don’t have to touch the URL yourself.
What it does
When a user returns from verification, the URL looks like this:vyget() reads the two reserved parameters and returns them as a typed object:
vyt— the confirmation token. This is the proof you exchange on your backend for the authoritative result.vyc— the client-side verdict hint:1(passed) or0(failed).
How it works
vyget() is fully synchronous and makes no network calls. It reads window.location.search, looks for vyc and vyt, and maps them:
| URL | Returns |
|---|---|
?vyt=tok_123&vyc=1 | { verified: true, token: "tok_123" } |
?vyc=0 | { verified: false, token: undefined } |
| (no vy params) | { verified: undefined, token: undefined } |
undefineds. Outside a browser (SSR) it also returns undefineds rather than throwing.
Use it on page load
Callvyget() when your page mounts. A token present means the user just came back from verifying — hand it to your backend to confirm, then clean the parameters off the URL so a refresh can’t replay them.
No token on the URL? Start a verification with
vycheck().