Install the widget
Add the widget script to your site, then call AiSupport.init with your
public project id. source is optional. Leave it unset when the project
has one knowledge source. Set it to that source's name when the project has several,
so the widget only offers actions for the app it is embedded in
(for example frontend).
<script src="https://acta.m7mlabs.com/static/widget.js"></script>
<script>
AiSupport.init({
projectId: "<uuid>",
source: "frontend",
authCallback: async () => ({ email, name, userId, permissions }),
headersCallback: async () => ({ Authorization: "Bearer " + accessToken }),
actionBase: "",
});
</script>
Omit source on a marketing page that should answer questions without
offering actions, when the project has more than one knowledge source.
Use a public project UUID here, never a builder API key.
See API keys.
The widget asks before it opens a ticket. Past chats and ticket replies stay on this browser without any server change. A reload restores the chat that was open. Visitors can start a new chat, open an older one, or hide one from the widget. Hiding a chat does not remove it from the agent inbox.
authCallback may return permissions as a list of strings.
If an action has a permission and that list does not include it, the widget hides
the form. If you omit permissions, the form still appears. The host
app remains the authority: a 401 or 403 from the action URL is shown as
“You don't have permission to run this action.”
sessionToken is optional. Leave it out and history stays on this browser.
To make chats and tickets follow a logged-in account onto another device, your server
checks that login and calls POST /api/v1/widget/identity/ with an identity
API key. Return the token from that response as sessionToken.
The public project id is still the only value that belongs in the browser. A missing
or failed token is ignored, and the widget keeps working.
email from authCallback fills the ticket form after the visitor
agrees. userId is not an access key. Do not use it to load someone else's chats.
headersCallback runs only when an action is submitted to your API.
Return the headers that request should send, such as
Authorization: Bearer. Those headers are not added to Acta config,
chat, or ticket calls. Leave it unset to keep the previous request.
actionBase is prepended to a relative action path. Leave it empty
when the page and your API share an origin root. Set it to /demo/shop
when the page is served under that prefix and the knowledge file still lists
/api/orders. A relative action path with cookies works when the
widget and your API share an origin. A cross-origin API needs an absolute URL
and CORS that allows credentials.
Free plans must keep the Powered by Acta link visible. Hiding it with CSS or JS is a Terms breach. Pro can turn branding off on the project.
Free widget chat is capped at 20 messages per day. Pro chat uses prepaid credits and pauses at $0 until the owner adds more. See pricing.