Skip to main content
Use ready() when you need to confirm that the Bily browser runtime initialized. Normal event tracking does not wait for it because track() queues early calls.

Check readiness

Verify the installation

In the browser, call init() before awaiting ready().

Know when it resolves

In 2.0.8, the promise resolves after the browser runtime finishes initialization and can accept queued events, not merely when its bootstrap script loads or exposes a queue. Queued events wait for that runtime handoff. Readiness is not a delivery receipt from an analytics destination. During server rendering, it resolves immediately because there is no browser script to load.

Handle a rejection

The promise rejects when:
  • The browser reports a script load error.
  • Bily does not finish runtime initialization before loadTimeoutMs, even if the bootstrap script loaded.
  • The script loads but does not expose a usable Bily browser API.
The default timeout is 15 seconds. Set a value from 1 to 60 seconds through init().

Retry one failed load

After a terminal load failure, call init() again. Then call ready() for the new attempt.
If production keeps failing, check the URL, network policy, and duplicate installation. Do not retry indefinitely.

Troubleshooting

Resolve timeouts, script errors, and conflicting configuration.