Initialization

Configure the SDK with your project credentials and preferences.

Overview

The init() method must be called before you can track any events. It initializes the local queue, generates an anonymous identity if one doesn't exist, and starts the session heartbeat.

Initialization

You can pass an optional configuration object as the second argument to customize the SDK's behavior.

javascript
1Solvof.init('YOUR_PUBLIC_API_KEY', { 2 distinctId: userId 3 debug: true 4 });

Configuration Options

ParameterTypeRequiredDescription
distinctIdstringNoUser ID of that user, applicable for store events.
debugbooleanNoIf true, the SDK will print verbose logs and payload details to the browser console. Useful for local development. Default: false.

Expected Result

If debug: true is enabled, you should see a log in your browser console stating [Solvof] Initialized successfully. Distinct ID: ....