Skip to content

JavaScript API

The bundle exposes a single global function Inviaro(method, ...args).

Hosted endpoints

URLContent
https://widget.inviaro.com/v1.jsThe widget bundle. Mutable, 5 min cache. Embed this in your page.
https://widget.inviaro.com/embedThe embed page for mobile WebViews and dedicated chat surfaces.
https://widget.inviaro.com/manifest.jsonBuild manifest with version + SHA-384 integrity hash.

All endpoints serve Access-Control-Allow-Origin: * and HTTPS-only.

Calling pattern

js
Inviaro('show');
Inviaro('identify', { userId: 'usr_42', userHash: '...', email: '...' });
Inviaro('consent', false);

Calls made before the bundle finishes loading are queued and replayed on init.

Methods

show

Open the chat panel.

js
Inviaro('show');

hide

Close the chat panel. Polling continues in the background. Unread messages still increment the launcher badge.

js
Inviaro('hide');

identify

Update visitor identity. Use after the visitor logs in or to refresh the signed userHash.

js
Inviaro('identify', {
  userId: 'usr_42',
  userHash: 'a1b2c3...',
  email: 'amar@example.com',
  name: 'Amar'
});
FieldRequiredNotes
userIdyesStable user id from your auth system.
userHashfor verificationServer-signed digest. Without it, userId is not trusted.
emailnoUsed as fallback when no pre-chat form.
namenoVisitor display name.

See Identity verification for the full contract.

logout

Clear stored session, profile, and identity claims.

js
Inviaro('logout');

Set the consent flag at runtime.

js
Inviaro('consent', true);
Inviaro('consent', false);

false purges stored data and demotes to memory-only mode. See Privacy and consent.

Diagnostics

Two read-only globals for support tickets:

GlobalTypePurpose
window.__INVIARO_VERSION__stringBundle version.
window.__INVIARO_API_BASE__stringConfigured API base URL.

Error reporting

The bundle logs errors to the browser console with an [Inviaro] prefix. Common patterns:

  • [Inviaro] settings.key missing. Set window.InviaroSettings.key before the bundle's script tag.
  • [Inviaro] settings.origin missing. Same, for origin.
  • [Inviaro] launcher mount point missing. The bundle ran twice. Verify the script tag is not duplicated.

The visitor never sees these. Production builds strip console output.