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
apiHostis set withoutapiPath, 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.
Load after consent#
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.cookieandoptions.storage: persistence configuration.
For a custom API proxy, configure the Segment-compatible integration with apiHost, apiPath, authMode, and delivery settings.
Verify delivery#
- Open the browser developer tools and select the Network panel.
- Send a test event and confirm a POST request to Ferno's
/eventsendpoint. - Confirm the request has a successful HTTP response.
- During development, catch and surface rejected SDK initialization and event promises.
Console logs alone do not prove that an event was delivered.