Skip to main content
Signature

Parameters

string
default:"https://app.concatflow.com"
The Concatflow origin to load widget.js from. A trailing / is removed. init uses the same origin unless you pass base to it too.

Returns

A promise of ConcatflowGlobal. Its init validates options before handing them to the hosted script.

Behaviour

  • Once. The first call injects <script src="…/widget.js" async> in <head>. Every later call returns the same promise.
  • Reuses your tag. If the page already has a <script> with the same src, it waits for that one instead of adding another.
  • Retryable. If loading fails (offline, blocked), the promise rejects and the next call tries again.
  • Browser only. On the server, it rejects. Import the package anywhere, call this function in the browser.

Errors

Constants

string
The default Concatflow origin.
number
The version of the options contract this package speaks. Sent as v with every init. See Versioning.