open-wa
DocsAPI reference

@open-wa/client

User-facing API client for open-wa WhatsApp automation

@open-wa/client

@open-wa/client provides the in-process TypeScript client for a WhatsApp Web session. It wraps the client created by @open-wa/core. For a remote HTTP server, use @open-wa/socket-client.

Part of the @open-wa v5 monorepo.

Install

npm install @open-wa/client@5.1.0 @open-wa/core@5.1.0 @open-wa/driver-puppeteer@5.1.0

Start a session and send a message

import { Client } from '@open-wa/client';
import { createClient } from '@open-wa/core';
import { PuppeteerDriver } from '@open-wa/driver-puppeteer';

const session = await createClient({
  sessionId: 'main-session',
  driver: new PuppeteerDriver(),
});
const client = new Client({ client: session, transport: session.getTransport() });

await client.start();
await client.sendText('447700900123@c.us', 'Hello from Open-WA');

await client.stop();

The client starts the browser session in your process. See the custom code guide for authentication and browser-profile setup.

Documentation

See the custom code guide for setup and how Open-WA works for the package roles.

License

H-DNH 1.1 — Hippocratic + Do Not Harm

Was this helpful?

Your answer includes the page path and docs version.

On this page