pk_test_... site key.
Before you start
Secured Accounts is part of a paid plan. See pricing. You need:- A site key whose allowed origins include your page. See Keys and environments.
- A signed-in user on your side, and a stable ID for that user’s account.
Steps
1
Turn on Link with BotShield ID
In the BotShield Console, open Secured Accounts. On the Link with BotShield ID tab, select Set up Link with BotShield ID and follow the three steps:
- The surface. Name the page where the chip goes, for example
Sign-in · app.example.com, and pick the site key for it. One surface has one site key. - The tag. Copy the tag the Console shows.
- Turn it on. In Production, the Console asks you to confirm with your Console passkey.
You can also offer the chip on a Human Gate. Open BotShield Gate, select the gate, and turn on Link with BotShield ID in its Configuration card. Then place the widget with
scope set to the gate’s key, as on the Widget reference.2
Add the widget after your sign-in
Show the chip only to a user you have just signed in or re-authenticated. The link says that the human confirming is the one using this account, so your own sign-in has to come first.
3
The person secures the account
The widget shows the Link with BotShield ID chip, with Tap to secure this account under the title.
The code lasts 5 minutes and works once. The person can scan the QR code, or type the code at
app.botshield.ai/link.In BotShield, the person sees your platform’s name and confirms with a passkey. The chip on your page then reads Account secured.4
Handle the result on your page
Listen for Treat
botshield:success and send the token to your server. trusted is true when the account is secured.trusted in the browser as a hint. The decision belongs on your server.5
Verify on your server
Send the token to Check all of these before you mark the account as secured:
POST /sdk/verify-token. The call needs no API key. The token lives 120 seconds.data.erroris absent andvalidistrue.organization_idis your organization. Pass your organization ID asaudienceand BotShield checks this for you.request_idis the one your page sent.trustedistrue.
trusted_since against your user record. See Token and webhooks for local verification and for the events your endpoint receives.6
Store the handle
Your webhook endpoint receives
account.secured with the account’s handle, an opaque value that starts with OP_. Store it beside your user. Every later account event carries it. See Staying in sync.7
See it in the Console
Open Secured Accounts, then the Registry tab, with the Development toggle selected. The account appears by its handle, with the date it was secured.The Try it tab runs the same chip against your Development key, with you as the customer. Use it to see each state before you ship.
Server-to-server
If you create verification requests from your server instead of using the widget, passpartner_user_ref to POST /sdk/create-verification-link for a Human Gate whose Link with BotShield ID switch is on. The same rules apply: a stable ID that is not an email address. notarize: false skips the offer for one request. notarize: true cannot turn the offer on while the gate’s switch is off. The request is then an ordinary verification.
