All documentation

Website Messenger

Put a chat widget on your site and answer visitors from the Inbox.

Website Messenger

Drop a chat widget onto your own site or app. Visitor messages land in your eConfirme Inbox as Website conversations, where your AI agent or your team answers them β€” alongside WhatsApp, Messenger, Instagram and Telegram.

These snippets use placeholders. Sign in and your own widget key fills in here automatically.
<!-- Optional. Already know who the visitor is? Declare it here and the
     messenger skips its pre-chat form. No backend needed.

     These values are treated exactly as if the visitor had typed them: they
     save the typing, they prove nothing. To have someone's conversation follow
     them to another device, sign user_hash on your server β€” see the Laravel or
     WordPress tab. -->
<script>
  window.econfirmeSettings = {
    app_id: 'pk_YOUR_KEY',
    name:  'Ahmed Alami',
    phone: '+212600000000',
  };
</script>

<!-- Required. Paste both before </body>. -->
<script src="https://econfirme.com/widget/econfirme-widget.js"
        data-econfirme-key="pk_YOUR_KEY" async></script>

Your public key identifies the widget, not a session β€” it is meant to be visible in page source. What must stay secret is the identity secret below.

When your site already knows who the visitor is, pass their details on boot together with a user_hash. eConfirme verifies the hash, takes the name and phone as given, and the visitor never sees a pre-chat form.

window.EConfirme('boot', {
  app_id: 'pk_YOUR_KEY',
  user_id: '42',                  // your user's id, as a string
  user_hash: '<hmac from your server>',
  name: 'Amina Benali',
  phone: '+212600000000',         // merges this chat with her WhatsApp thread
  email: 'amina@example.com',
});

user_hash is an HMAC-SHA256 of your user's id, keyed by your widget's identity secret. Compute it on your server β€” anyone holding that secret can impersonate any of your customers.

// Runs on your server. The secret never reaches the browser.
import { createHmac } from 'node:crypto';

export const econfirmeUserHash = (userId) =>
  createHmac('sha256', process.env.ECONFIRME_IDENTITY_SECRET)
    .update(String(userId))
    .digest('hex');

Generate the secret under Channels β†’ Website Messenger β†’ Identity verification. It is shown once, at the moment you create it.

Include a phone number wherever you have one. The web conversation then merges into that customer's WhatsApp thread and order history instead of living on its own β€” the same person, one conversation, whichever channel they use.