feat: add native mobile api docs

This commit is contained in:
SamuelScheit
2023-05-26 14:13:12 +02:00
parent 9cc0d5e576
commit 844de431a3

View File

@@ -42,7 +42,9 @@ import makeWASocket from '@whiskeysockets/baileys'
TODO
## Connecting
## Connecting multi device (recommended)
WhatsApp provides a multi-device API that allows Baileys to be authenticated as a second WhatsApp client by scanning a QR code with WhatsApp on your phone.
``` ts
import makeWASocket, { DisconnectReason } from '@whiskeysockets/baileys'
@@ -83,6 +85,12 @@ If the connection is successful, you will see a QR code printed on your terminal
**Note:** the code to support the legacy version of WA Web (pre multi-device) has been removed in v5. Only the standard multi-device connection is now supported. This is done as WA seems to have completely dropped support for the legacy version.
## Connecting native mobile api
Baileys also supports the native mobile API, which allows users to authenticate as a standalone WhatsApp client using their phone number.
Run the [example](Example/example.ts) file with ``--mobile`` cli flag to use the native mobile API.
## Configuring the Connection
You can configure the connection by passing a `SocketConfig` object.