Browser SDK

Setup and initialization

Initialize the Ferno browser SDK safely.

Install#

Load immediately#

writeKey is the project browser write key. The Segment-compatible delivery integration uses the same project key as apiKey, Ferno's data host as apiHost, and /events as apiPath. authMode: 'bearer' selects bearer authorization, and retryQueue: true preserves retry behavior.

Important: If apiHost is set without apiPath, the SDK may derive a type-based path instead of /events, causing delivery failures.

The explicit cdnSettings object prevents initialization from depending on remote settings discovery. load returns a buffered instance; event methods return promises for dispatched events.

Call .load() once. Use disableClientPersistence: true when browser identity must not be stored.

Settings#

AnalyticsBrowser.load(settings, options) accepts:

  • settings.writeKey: required Ferno project key.
  • settings.cdnSettings: settings object that avoids fetching remote settings.
  • settings.plugins: installed plugins.
  • settings.classicIntegrations: legacy integrations.
  • options.instrumentation: opt-in instrumentation configuration.
  • options.disableClientPersistence: disable cookies/local storage.
  • options.initialPageview: configure initial page-view behavior.
  • options.integrations: integration overrides.
  • options.cookie and options.storage: persistence configuration.

For a custom API proxy, configure the Segment-compatible integration with apiHost, apiPath, authMode, and delivery settings.

Verify delivery#

  1. Open the browser developer tools and select the Network panel.
  2. Send a test event and confirm a POST request to Ferno's /events endpoint.
  3. Confirm the request has a successful HTTP response.
  4. During development, catch and surface rejected SDK initialization and event promises.

Console logs alone do not prove that an event was delivered.