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

# TypeScript Support

> Use the Node.js SDK with TypeScript.

`@zixflow/analytics-node` ships type definitions.

```typescript theme={null}
import {
  Analytics,
  AnalyticsSettings,
  UserTraits,
} from '@zixflow/analytics-node'

const settings: AnalyticsSettings = {
  writeKey: 'YOUR_WRITE_KEY',
  maxEventsInBatch: 20,
  flushInterval: 10000
}

const analytics = new Analytics(settings)

analytics.identify({
  userId: 'user@example.com',
  traits: {
    email: 'user@example.com',
    first_name: 'John',
    last_name: 'Doe'
  } satisfies UserTraits
})

process.on('SIGTERM', async () => {
  await analytics.closeAndFlush()
  process.exit(0)
})
```

Useful exported types include `Analytics`, `AnalyticsSettings`, `TrackParams`, `IdentifyParams`, `PageParams`, `GroupParams`, `AliasParams`, `Context`, `Plugin`, `UserTraits`, and `GroupTraits`.
