Skip to main content
The Libredesk live chat widget embeds on any website as a single <script> tag. Visitors can start conversations anonymously, or you can verify their identity with a server-signed JWT so the widget loads with their profile attached.

Create a live chat inbox

1

Add the inbox

Go to Admin → Inboxes → New inbox → Live chat. Fill in the name, brand name, and website URL.
2

Configure appearance and messages

Set the launcher colour, position, logo, greeting message, and home screen under the Appearance and Messages tabs. All changes are live as soon as you save.
3

Copy the install snippet

Open the Installation tab and copy the <script> snippet shown there. Paste it before the closing </body> tag on every page where the widget should appear.

Install the widget

The anonymous snippet looks like this:
baseURL is the URL of your Libredesk instance. inboxID is the UUID shown on the inbox’s Installation tab. Anyone visiting the page can now open the widget and start a conversation. Every session is treated as a new anonymous visitor unless you add identity verification.

Identity verification

If users are already signed into your product, pass a signed JWT so the widget loads with their existing Libredesk contact. Without verification, the widget cannot tell a returning user apart from a new visitor on a new device.

How it works

  1. Your server signs a JWT with the inbox Secret key (set under the Security tab).
  2. Your page passes that JWT to the widget via userJWT.
  3. Libredesk verifies the signature, then upserts the contact by external_user_id.
The signing algorithm is HS256 (HMAC-SHA256). The secret never leaves your server.

JWT payload

Sign the token on your server

Never embed the inbox secret in client-side code. Sign the JWT on your server and inject it into the page at render time, or fetch it from an authenticated endpoint.

Pass the token to the widget

JavaScript API

Once the widget loads, window.Libredesk exposes these methods: Example:

Conversation continuity

Contacts don’t have to stay in the live chat. If they leave before the conversation is finished, Libredesk can automatically email them any unread messages. Replies to the email thread are added back to the same live chat conversation.

Security

Trusted domains

Under the Security tab, list the domains allowed to embed the widget. Requests from other origins are rejected. Supports wildcards:
Leave this empty to allow all origins. Set it in production.

Blocked IPs

Block specific IPs or CIDR ranges from opening the widget:

Session duration

Controls how long a widget session stays authenticated before the JWT must be re-verified. Default is 10h. Format accepts s, m, h (e.g. 30m, 24h).