Configuration
The widget is configured through an options object passed to the constructor, or through a JSON data-config attribute on the mount element. When both are present, data-config values win.
let widget = new window.Sitata.claims(el, {
orgId: "<YOUR ORG ID>",
token: "<YOUR PUBLIC TOKEN>",
isB2B: true
});
widget.run();
Options
| Property | Type | Default | Description |
|---|---|---|---|
| orgId | String | โ | Required. Your organization's identifier. The widget will not load without it. |
| token | String | โ | Required. Your organization's public authentication token. Sent as Authorization: PUB <token>. |
| apiBase | String | https://www.sitata.com/api/v2 | Override the REST API base URL. |
| isB2B | Boolean | false | Whitelabel mode. When true, your branding is used and a "Powered by Sitata" footer is shown. When false, Sitata branding is used. |
| companyName | String | "Sitata" | Company name shown in the header and on the login screen. |
| logoUrl | String | โ | URL of your logo, shown in the header and login screen (whitelabel mode). |
| primaryColor | String | #1E88E5 | Primary theme color (hex). |
| accentColor | String | #FF8F00 | Accent/secondary theme color (hex). |
| hideHeader | Boolean | false | Hide the widget's header bar so it nests inside your own page chrome. A simple inline "Back" control is used instead. |
| lang | String | auto | Force the UI language (two-letter code, e.g. es). Otherwise a ?lang= URL parameter, then the browser language, then English is used. |
| userToken | String | โ | A pre-authenticated token for the signed-in customer. When supplied and valid, the widget skips the PIN login entirely. |
| subscriptionId | String | โ | Deep-link: on load, start a new claim under this subscription (policy), skipping the list and policy-selection step. |
| claimId | String | โ | Deep-link: on load, open this specific existing claim's detail view. |
| socketUrl | String | wss://sockets.sitata.com/socket/websocket | WebSocket endpoint used for live support chat. |
| httpBase | String | https://www.sitata.com | Base host used by supporting API helpers. |
info
There is no separate currency option โ a claim's currency is taken from the policy (subscription) it belongs to.
Example
<div id="claims-app"></div>
<script>
window.document.addEventListener("sitata:claimsReady", function () {
var el = document.getElementById("claims-app");
var widget = new window.Sitata.claims(el, {
orgId: "0774f78c-56ff-47d8-989e-b050d72a2c7f",
token: "f7ed4b59-2981-499b-b33a-b09255cb950f",
isB2B: true,
companyName: "Air Advisor",
logoUrl: "https://airadvisor.com/logo.png",
primaryColor: "#f05800",
accentColor: "#f000e8",
hideHeader: true,
userToken: "THIS_CUSTOMERS_TOKEN",
subscriptionId: "THE_SUBSCRIPTION_ID"
});
widget.run();
});
</script>
<script async src="https://www.sitata.com/widgets/claims.js"></script>
Deep-Linking A Customer To A Claim
The widget scopes claims to a customer's subscriptions (policies). To send a specific customer straight to the right place, combine:
orgId+tokenโ identify your organization.userTokenโ pre-authenticate the customer so they skip login.- Either
subscriptionId(start a claim under that policy) orclaimId(open an existing claim).
As a fallback, if the page's own URL path ends with a claim's UUID, the widget will detect it and open that claim. An explicit claimId takes precedence over the URL.
Events
The widget exposes a single lifecycle event:
| Event | Description |
|---|---|
| sitata:claimsReady | Fired on document once the widget bundle has loaded and is ready to be instantiated. Initialize the widget inside a listener for this event. |
warning
The widget does not currently emit domain callbacks such as "claim submitted" or "status changed" to the host page โ its state stays inside the widget. If you need your portal to react to claim progress, drive it from the server-side claim webhooks (events 600โ607) instead.
Styling
Theming is driven by the primaryColor and accentColor options. The widget renders as a responsive, full-width application and inherits your page's font, so in most cases setting your brand colors, logoUrl, and hideHeader is all that is needed. The widget currently renders in a light theme.
Environments
The loader and widget bundle are served from Sitata's own domain:
| Environment | Loader script |
|---|---|
| Production | https://www.sitata.com/widgets/claims.js |
| Staging | https://staging.sitata.com/widgets/claims.staging.js |
Point apiBase (and, if used, socketUrl) at the matching environment.