# @buzztrail-ai/gating

Pre-conversation lead capture form with internationalization support.
**Single source of truth** for gating across all BuzzTrail packages.

## Features

- Multi-language Support: 5 languages (en, no, de, es, fr)
- Email Validation: Format validation + optional free provider blocking
- Phone Validation: International phone number format support
- GDPR Compliance: Privacy policy/terms consent
- Flexible Storage: Supabase, webhook, or both
- Responsive Design: Mobile and desktop
- TypeScript: Full type safety
- React Hooks: useGatingForm hook

## Installation

```bash
pnpm add @buzztrail-ai/gating @supabase/supabase-js react react-dom
```

## Quick Start

```tsx
import { GatingForm, initGatingI18n } from '@buzztrail-ai/gating';

await initGatingI18n('no');

<GatingForm
  config={{
    enabled: true,
    language: 'no',
    collectInfo: ['name', 'email'],
    requiredInfo: ['email'],
    emailValidation: { blockFreeProviders: false },
    gdprCompliant: true,
    storage: { destination: 'supabase' },
  }}
  customerId="my-company"
  onSubmit={async (data) => { /* submit */ }}
/>
```

## License

ISC
