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

# Core Features

> User identification, event tracking, and core SDK features for React Native.

### User Identification

Identify users to track their behavior across sessions and devices:

```typescript theme={null}
import { Zixflow } from 'zixflow-reactnative';

// Identify user with ID only
Zixflow.identify({
  userId: 'user-123'
});

// Identify user with traits
Zixflow.identify({
  userId: 'user-123',
  traits: {
    email: 'user@example.com',
    firstName: 'John',
    lastName: 'Doe',
    plan: 'premium'
  }
});
```

**When to identify users**:

* After successful login
* When user information becomes available
* After account creation

### Event Tracking

Track custom events to understand user behavior:

```typescript theme={null}
import { Zixflow } from 'zixflow-reactnative';

// Track event without properties
Zixflow.track('button_clicked');

// Track event with properties
Zixflow.track('product_viewed', {
  product_id: '12345',
  product_name: 'Premium Plan',
  category: 'subscription',
  price: 29.99
});

// Track with Map (alternative syntax)
const properties = new Map<string, any>();
properties.set('item_count', 3);
properties.set('total_amount', 89.97);
Zixflow.track('checkout_completed', properties);
```

**Common events to track**:

* User actions (button clicks, form submissions)
* E-commerce events (product views, purchases)
* Content interactions (article reads, video plays)
* Feature usage

### Screen Tracking

Track screen views to understand user navigation:

```typescript theme={null}
import { Zixflow } from 'zixflow-reactnative';

// Track screen view
Zixflow.screen('HomeScreen');

// Track screen with properties
Zixflow.screen('ProductDetailScreen', {
  product_id: '12345',
  category: 'electronics'
});
```

**Automatic screen tracking** with React Navigation:

```typescript theme={null}
import { NavigationContainer, NavigationContainerRef } from '@react-navigation/native';
import { Zixflow } from 'zixflow-reactnative';
import React, { useRef } from 'react';

export default function App() {
  const navigationRef = useRef<NavigationContainerRef>(null);
  const routeNameRef = useRef<string>();

  return (
    <NavigationContainer
      ref={navigationRef}
      onReady={() => {
        routeNameRef.current = navigationRef.current?.getCurrentRoute()?.name;
      }}
      onStateChange={async () => {
        const previousRouteName = routeNameRef.current;
        const currentRouteName = navigationRef.current?.getCurrentRoute()?.name;

        if (previousRouteName !== currentRouteName && currentRouteName) {
          // Track screen change
          Zixflow.screen(currentRouteName);
        }

        // Save current route name
        routeNameRef.current = currentRouteName;
      }}
    >
      {/* Your navigation setup */}
    </NavigationContainer>
  );
}
```

### User Profile Attributes

Set custom attributes on user profiles:

```typescript theme={null}
import { Zixflow } from 'zixflow-reactnative';

// Set profile attributes
Zixflow.setProfileAttributes({
  plan: 'premium',
  subscription_status: 'active',
  last_login: new Date().toISOString(),
  preferences: {
    newsletter: true,
    notifications: true
  }
});
```

### Device Attributes

Set custom attributes on the current device:

```typescript theme={null}
import { Zixflow } from 'zixflow-reactnative';

// Set device attributes
Zixflow.setDeviceAttributes({
  app_version: '2.1.0',
  build_number: '421',
  theme: 'dark',
  language_preference: 'en-US'
});
```

### Clearing User Identity

Clear user identity when users log out:

```typescript theme={null}
import { Zixflow } from 'zixflow-reactnative';

// Clear identify on logout
const handleLogout = async () => {
  // Clear Zixflow identity
  Zixflow.clearIdentify();

  // Perform other logout actions
  // ...
};
```

***
