> ## 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

> SDK method reference for the Zixflow React Native integration.

### Core SDK

#### `Zixflow.initialize(config: ZixflowConfig): void`

Initialize the SDK with configuration.

```typescript theme={null}
Zixflow.initialize({
  apiKey: 'YOUR_API_KEY',
});
```

#### `Zixflow.identify(params: { userId: string; traits?: object }): void`

Identify a user with optional traits.

```typescript theme={null}
Zixflow.identify({
  userId: 'user-123',
  traits: { email: 'user@example.com' }
});
```

#### `Zixflow.clearIdentify(): void`

Clear the current user's identity.

```typescript theme={null}
Zixflow.clearIdentify();
```

#### `Zixflow.track(name: string, properties?: object | Map<string, any>): void`

Track a custom event.

```typescript theme={null}
Zixflow.track('button_clicked', { button_name: 'signup' });
```

#### `Zixflow.screen(name: string, properties?: object): void`

Track a screen view.

```typescript theme={null}
Zixflow.screen('HomeScreen');
```

#### `Zixflow.setProfileAttributes(attributes: object): void`

Set attributes on the user profile.

```typescript theme={null}
Zixflow.setProfileAttributes({ plan: 'premium' });
```

#### `Zixflow.setDeviceAttributes(attributes: object): void`

Set attributes on the current device.

```typescript theme={null}
Zixflow.setDeviceAttributes({ app_version: '2.0.0' });
```

### Push Messaging

#### `Zixflow.pushMessaging.showPromptForPushNotifications(options): Promise<ZixflowPushPermissionStatus>`

Request push notification permission.

```typescript theme={null}
const status = await Zixflow.pushMessaging.showPromptForPushNotifications({
  ios: { sound: true, badge: true }
});
```

### In-App Messaging

#### `Zixflow.inAppMessaging.registerEventsListener(callback): EventSubscription`

Register a listener for in-app message events.

```typescript theme={null}
const listener = Zixflow.inAppMessaging.registerEventsListener((event) => {
  console.log('In-app event:', event);
});

// Remove listener
listener.remove();
```

#### `Zixflow.inAppMessaging.dismissMessage(): void`

Dismiss the currently displayed in-app message.

```typescript theme={null}
Zixflow.inAppMessaging.dismissMessage();
```

### Types

#### `ZixflowConfig`

Configuration object for SDK initialization.

```typescript theme={null}
interface ZixflowConfig {
  apiKey: string;
  logLevel?: ZixflowLogLevel;
  inApp?: {
  };
  autoTrackDeviceAttributes?: boolean;
  trackApplicationLifecycleEvents?: boolean;
  autoTrackScreenViews?: boolean;
  trackingApiUrl?: string;
}
```

#### `ZixflowLogLevel`

Log level enum.

```typescript theme={null}
enum ZixflowLogLevel {
  none = 'none',
  error = 'error',
  info = 'info',
  debug = 'debug'
}
```

#### `ZixflowPushPermissionStatus`

Push notification permission status.

```typescript theme={null}
enum ZixflowPushPermissionStatus {
  Granted = 'granted',
  Denied = 'denied',
  NotDetermined = 'notDetermined'
}
```

#### `InAppMessageEventType`

In-app message event types.

```typescript theme={null}
enum InAppMessageEventType {
  messageShown = 'messageShown',
  messageDismissed = 'messageDismissed',
  messageActionTaken = 'messageActionTaken',
  errorWithMessage = 'errorWithMessage'
}
```

#### `InAppMessageEvent`

In-app message event object.

```typescript theme={null}
interface InAppMessageEvent {
  eventType: InAppMessageEventType;
  deliveryId?: string;
  messageId?: string;
  actionName?: string;
  actionValue?: string;
}
```
