An assistant on your site can address a signed-in visitor by name. For that, the server of your site passes on a short, signed JWT. Everything your developer needs is under Support, Settings, Signed-in users, in the block What your site needs.
This is one part of the Support Studio. Creating an assistant, giving it knowledge and taking over live is covered in Support Studio. Knowledge from a portal behind a login is covered in Knowledge from a portal behind a login. This page is about something else: letting the assistant know who is signed in.
What your site needs
- Assistant id for
aud, with a copy button. You may use the public key fromdata-assistent(dps_...) asaudinstead; both work. - The secret (
dpi_...), shown once. The screen shows whether it is active, what it starts with, when it was created and until when a previous secret still works. - The last check: when it last succeeded, and the last rejection reason with an explanation.
Checklist
- Put the secret in the server environment of your site, for example as
DENKPLOEG_STEUN_GEHEIM. Never in the page, the browser code or the repo. - Create a JWT with HS256, with
audandexp(at most 1 hour ahead, 10 minutes recommended). - Pass it via
data-identiteiton the script, or withdenkploegSteunIdentificeer(jwt). - Switch the assistant on under General. If it is off, the button doesn't load on your site.
- Test with "Do you know who I am?".
Optional in the JWT: sub, naam, email, rol, klant and velden. Don't put passwords or sensitive data in it; your team members see them in the conversation.
Prompt for your developer
The button Copy prompt for your developer puts a ready-made brief on your clipboard: assistant id, start of the key, the claims table, an example in Node.js and PHP, rules and testing. The secret itself is never in it; you hand that over separately.
When it doesn't work
A proof that doesn't check out gives no error message: the visitor is then anonymous. The screen shows the last reason and what your site should do.
| Reason | What it means | What the site does |
|---|---|---|
handtekening | The signature doesn't match the secret. | Sign with the current secret; restart after switching. |
verlopen | The proof had already expired. | Fresh proof per page view, exp 10 minutes ahead, check the clock. |
aud | aud is not the assistant id. | Use the assistant id or the dps_ key. |
formaat | Not a JWT of three parts. | Only the JWT, without Bearer or quotes. |
algoritme | Not HS256. | Sign with HS256. |
geen-exp | exp is missing. | Add exp. |
te-lang-geldig | exp is more than 1 hour ahead. | At most 1 hour, 10 minutes recommended. |
nog-niet-geldig | iat or nbf is in the future. | Check the server's clock. |
claims-te-groot | The proof or a claim is too large. | Stay within the limits in the prompt. |
claims-ongeldig | A claim has the wrong type, or the email address is invalid. | Text for the fixed claims, an object for velden. |