Chatly: support chat
Connect Chatly from the catalog: chat events on the right person, and View replay and View person links on each conversation.
Chatly is the chat widget Lucida's own app uses for support. Lucida has a native Chatly connector in the catalog.
Connect Chatly (no code)
In Chatly, create a workspace API key with
workspace:readandworkspace:writescopes.In Chatly, create a webhook endpoint for
conversation.created,conversation.closed,conversation.reopenedandsurvey.response_received, and turn onverified_identity_only. Chatly shows the endpoint's signing secret once.In Lucida, open Integrations, pick Chatly, paste the API key and the signing secret, and point the Chatly webhook endpoint at the connector's webhook URL. Optional settings:
app_url(your Lucida UI host, defaulthttps://lucidace.com) andbase_url(defaulthttps://api.chatlychat.com).
What you get:
Event | Chatly source | Properties |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Message text, subject and the rating comment are never read. A rating that names no conversation, or is not a CSAT, is acknowledged and ignored.
The join key. The person is the first non-empty of the contact's
principal,externalId,external_id,ext, in that order, and it must equal the Lucidadistinct_id. With Atlas identity on both sides, Chatly'sprincipalis the Atlassub, which is what Lucida'sdistinct_idalready is, so the person matches with no extra wiring (ext, the product's own user id such as a database cuid, is only used when nothing else is set). Without Atlas, pass the id you give Lucidaidentifyas the contact'sexternalId. A visitor Chatly could not verify has noexternalId, so the event is personless underconv_<conversation id>; with no identity verification in your Chatly workspace every event is personless, which is expected.Anonymous visitors. Chatly's webhooks carry
contact.id,contact.externalId,contact.identityVerified(andprincipal,external_idorextwhen Chatly sends them); visitor custom attributes and page context are not part of the payload, so an anonymous chat cannot be joined to the visitor's anonymous Lucida person. It stays personless. To get the person, identify the visitor to Chatly with a verified identity (the same user id you pass to Lucidaidentify).On each new conversation with a known person, Lucida writes two links to the conversation's external links (
GET/PUT /v1/conversations/{id}/external-links; the body is{"links":[{"label","url"}]}): View replay opens the person's most recent session replay (/replays/<session id>, from their events in the last 30 days; the sessions list/sessions?distinct_id=<person>when none is found) and View person opens/persons/<person id>. Both are replaced on each run, never stacked, and other API-written links are kept. A failed write-back is logged and does not fail the delivery.Disconnect. Deleting the connector makes its webhook URL answer 404 and stops the write-back; disabling it does the same. Chatly will then show failed deliveries until you remove or pause the endpoint in Chatly.
Deliveries are verified with Chatly's scheme: header
X-Livechat-Signature: t=<unix>,v1=<hex>, HMAC-SHA256 over<t>.<raw body>, 5-minute tolerance. Chatly's secret rotation is a hard cut: rotate in Chatly and in the connector together.
Link the exact session replay
To put the replay of the visitor's current session on the conversation, turn on the browser SDK handoff:
init("lc_pk_...", { replay: { supportWidgets: { chatly: true } } });Once Chatly is on the page (web widget only), the SDK calls Chatly("setContext", { links: [{ label: "View replay", url }] }) with lucida.getReplayUrl(). Chatly shows visitor-written links apart from the workspace's own. Opening the link needs a Lucida login with replay access. You can also do the same yourself from your server with PUT /v1/conversations/{id}/external-links and {"links":[{"label":"Session replay","url": ...}]}. The details are in Support tools.
React Native
Chatly's React Native SDK has no setContext or links call, so the exact-replay link cannot be handed over from an Expo app. The connector's server-side View replay link (the person's latest session) and View person link work for every channel, including the app, as long as the user is identified to Chatly.
Alternative: the webhook preset
If you would rather not use the connector, Chatly conversation and CSAT events can flow into Lucida through a webhook source with the preset chatly:
curl -X POST https://<your-lucida>/v1/projects/<project-id>/webhook-sources \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"name":"Chatly","mapping":{"preset":"chatly"},"auth":{"mode":"chatly","secret":"<signing secret>"}}'In Chatly, create a webhook endpoint for the analytics events (
conversation.created,conversation.closed,survey.response_received) pointing at the source URL from the answer, with the same secret. Turn onverified_identity_only.Deliveries are verified in
chatlymode: thex-livechat-signatureheadert=<unix>,v1=<hex>is an HMAC-SHA256 over<t>.<raw body>, with a 5-minute timestamp tolerance. It is not a plain body HMAC, so the generichmacmode will not verify it.conversation.createdandconversation.closedarrive as events named after the type (conversation.created, not$chat_started) with$ai_conversation_id(andstatus,channel(from Chatly'schannelType) on created); message text is never read.survey.response_receivedwithkindcsatarrives as a plaincsat.submittedevent (ratingfromscore,kind,survey_id,response_id,comment_length(the length only, never the comment text),$ai_conversation_id). Other types are acknowledged and ignored.The person is the contact's
principal, elseexternalId,external_id,ext(first non-empty). Without one the event is personless underconv_<conversation id>.
Chatly's secret rotation is a hard cut: there is no overlap window, so rotate the secret in Chatly and in the Lucida source together, or deliveries fail until both match.