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

# WhatsApp Adapter

> Deploy your bot to WhatsApp

## Setup

### 1. Install

```bash theme={null}
npm install @boostgpt/router
```

### 2. Configure

```bash .env theme={null}
WHATSAPP_CONTACTS=2349012345678,2349087654321
```

## Usage

```javascript theme={null}
import { Router, WhatsAppAdapter } from '@boostgpt/router';

const router = new Router({
  apiKey: process.env.BOOSTGPT_API_KEY,
  projectId: process.env.BOOSTGPT_PROJECT_ID,
  adapters: [
    new WhatsAppAdapter({
      allowedContacts: process.env.WHATSAPP_CONTACTS.split(','),
      useLocalAuth: true
    })
  ]
});

await router.start();
// Scan QR code when prompted
```

## Options

**allowedContacts** `Array\<string\>`

Whitelist of phone numbers (with country code, no +)

**useLocalAuth** `boolean` (default: true)

Save session locally

## QR Code

Scan the QR code with WhatsApp on your phone to authenticate.

> [!NOTE]
>
> The first time you run it, scan the QR code. Sessions are saved locally for subsequent runs.


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