মূল অংশে যান

Recognise signed-in visitors in the website widget

সর্বশেষ হালনাগাদ ৩১ অক্টোবর, ২০২৬ · এই গাইডটি শুধু ইংরেজিতে পাওয়া যায়।

Before you start

  • The website widget is installed and working.
  • You can change your site's server code. The widget secret must stay on your server and never go into page code.
  • Your site has its own sign-in, and each user has a stable id.

Steps

  1. Open Connections, then the Website widget page. Find Signed-in visitors and choose Create secret.
  2. Copy the secret now. It is shown once. Store it on your server, for example in an environment variable. Then choose I saved it.
  3. On your server, sign the signed-in user's id with HMAC-SHA256 using the secret. Write the result as lowercase hex. This is the user_hash. The page shows Example of signing a user id in several languages.
  4. Give the page the user_id and user_hash, and optionally name, email and attributes. Start the widget with:
Wizzen('boot', { user_id, user_hash, name, email, attributes })
  1. If the person signs in after the page has loaded, call Wizzen('identify', { ... }) with the same fields. The chat so far continues.
  2. When the person signs out of your site, call Wizzen('shutdown'). It forgets the visitor, the chat and the identity in that browser, so the next person on a shared device does not see the old chat.

Other calls: Wizzen('open') and Wizzen('close') open and close the chat.

Good to know

  • attributes is one flat object of text (up to 200 characters), numbers or true/false values, with at most 20 keys and 2 KB of JSON. Your agent reads them as facts about the customer, such as plan. Only attributes with a valid signature are stored.
  • With a valid signature the chat becomes that user's Verified contact. An anonymous chat already in progress continues on it.
  • If the chat on this browser already belongs to a different signed-in person, the widget starts a fresh chat.
  • Rotate secret stops the old secret at once. Update your server with the new one straight away.
  • The secret is stored encrypted and never shown again after you create it.
  • Never expose a page or endpoint that signs any user_id a visitor sends. Sign only the id of the current signed-in session.

If something goes wrong

  • The visitor stays anonymous. Open the browser console. widget.identity_invalid means the signature does not match: check that you sign the exact same user_id string, with the current secret, as lowercase hex. widget.identity_not_enabled means no secret exists yet.
  • The widget does not appear. The page must be on a domain listed under Domains on the Website widget page.

Still stuck? Write to [email protected].

এখনও সাহায্য লাগবে?

কী করতে চাইছেন আমাদের জানান, একজন মানুষ ইমেইলে উত্তর দেবেন।

যোগাযোগ করুন