Customization and Reference
Component <m8ty-chat>
Kind | Name | Description |
|---|---|---|
Attribute |
| Share ID (required) |
Attribute |
|
|
Attribute |
|
|
Attribute |
| Override of the Ragty chat API URL; only needed for special proxy setups |
Property |
| Delegated shares: |
Property |
| Component version (read-only) |
Method |
| Starts a new, empty conversation |
Event |
| Session established; |
Event |
|
|
Event |
| The session could not be renewed (e.g. |
Events bubble and cross the shadow boundary. They never contain tokens, chat content or user identifiers.
Type declarations: https://rag.example.com/embed-assets/v1/m8ty-chat.d.ts.
Theming
Set CSS custom properties on the element:
Style individual parts with ::part():
Parts: container, header, history, messages, message, message-user, message-assistant, sources, input-row, input, send.
Behavior
Answers stream in; numbered markers
[1]refer to the cited sources listed below the answer (document name, page, link for web sources).The history button lists the user's previous chats; they can be reopened and deleted by the user.
Maximum question length and daily quota are configured on the share; the component shows a localized message when they are reached.
iframe
Kind | Name | Description |
|---|---|---|
Query parameter |
|
|
Query parameter |
|
|
Attribute |
| Required: lets the iframe determine your page origin |
Attribute |
| Optional: allows the chat to write to the clipboard |
Function |
| Delegated shares: answers the iframe's ticket requests; returns a function that disconnects it. Exported by |
The iframe requests a ticket on start and whenever the session must be renewed. It repeats the request with backoff until your page acknowledges it and gives up after 15 seconds; connectIframe calls getTicket only once per request, even if it was repeated. See iframe. Theming via CSS is not possible inside the iframe; use theme or the web component.
HTTP endpoints you call
Only one endpoint is called by your code, and only for delegated shares.
POST /api/v1/embed/tickets (server to server)
Caller | Your backend only |
Headers |
|
Body |
|
Success |
|
Status |
| Meaning | What to do |
|---|---|---|---|
|
| Missing headers, unknown/revoked/expired gateway key, or invalid assertion ( | Check key and assertion format (How the User Is Passed) |
|
| Origin not allowed for the share, assertion issuer differs from the share's issuer, or user erased/blocked | Use an allowed origin; check issuer; contact the administrator |
|
| Share unknown, disabled, expired, not delegated, not bound to this gateway key, or delegation disabled on the platform | Check the share with the administrator |
|
| Malformed origin, share ID or nonce | Fix the request |
|
| Too many tickets for this gateway key | Retry later; do not request tickets in a loop |
|
| Ragty state backend unavailable | Retry with backoff |
HTTP endpoints called by the component
For reference and for firewall/proxy rules — you do not call them yourself.
Method | Path | Purpose |
|---|---|---|
|
| Name, greeting and limits of the share |
|
| Public: resume or create the anonymous visitor |
|
| Delegated: redeem the ticket |
|
| List / create own chats |
|
| Read / delete own chat |
|
| Ask a question (Server-Sent Events) |
|
| Component script |
|
| iframe page |
All chat requests carry X-M8TY-Embed: 1, an Authorization: M8TY-PoP <token> header and an M8TY-PoP proof signed by the browser's non-exportable device key. Responses: 401 unauthorized, 404 unavailable, 429 rate_limited (with Retry-After), 503 temporarily_unavailable.
If you run a reverse proxy or WAF in front of your own site, nothing has to be configured for these calls — they go directly from the browser to the Ragty URL. Make sure response buffering is disabled for Server-Sent Events if you proxy the Ragty URL itself.