> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zixflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Browser SDK method reference for @zixflow/analytics-browser.

### AnalyticsBrowser.load(settings, options?)

Initialize the analytics instance.

**Settings**

| Key | Type | Required | Description |
| - | - | - | - |
| `writeKey` | `string` | Yes | Your Zixflow write key |
| `cdnURL` | `string` | No | Override CDN base URL |
| `cdnSettings` | `object` | No | Skip remote settings fetch |
| `plugins` | `Plugin[]` | No | Plugins to register at load |
| `timeout` | `number` | No | Dispatch timeout (default `300`) |

**Init options** — see [Advanced Configuration](https://docs.zixflow.com/documentation/sdk/javascript/advanced-configuration.md).

**Returns:** `AnalyticsBrowser` (buffered instance that resolves to `Analytics`)

***

### analytics.identify(userId?, traits?, options?, callback?)

Identify a user. Returns `Promise<Context>`.

***

### analytics.track(event, properties?, options?, callback?)

Track an event. Returns `Promise<Context>`.

***

### analytics.page(category?, name?, properties?, options?, callback?)

Track a page view. Returns `Promise<Context>`.

***

### analytics.screen(category?, name?, properties?, options?, callback?)

Track a screen view. Returns `Promise<Context>`.

***

### analytics.group(groupId, traits?, options?, callback?)

Associate the current user with a group. Returns `Promise<Context>`.

Calling `analytics.group()` with no arguments returns the persisted `Group` instance.

***

### analytics.alias(to, from?, options?, callback?)

Merge identities. Returns `Promise<Context>`.

***

### analytics.reset()

Clear user and group identity. Returns `Promise<void>` / clears persistence.

***

### analytics.ready(callback?)

Run when all plugins are ready. Returns `Promise<void>`.

***

### analytics.user()

Returns the `User` instance (id, anonymousId, traits).

***

### analytics.setAnonymousId(id?)

Set (or read) the anonymous ID.

***

### analytics.debug(toggle)

Enable or disable debug logging.

***

### analytics.register(...plugins) / analytics.deregister(...names)

Register or remove plugins.

***

### analytics.addSourceMiddleware(fn)

Add source middleware for all events.

***

### analytics.addDestinationMiddleware(integrationName, ...fns)

Add middleware for a specific destination.

***

### subscribeToPush(analytics, options?) / unsubscribeFromPush(analytics, options?)

Web Push helpers exported from `@zixflow/analytics-browser`. See [Web Push Notifications](https://docs.zixflow.com/documentation/sdk/javascript/web-push-notifications.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.