open-wa logoopen-wa

Sessions and login

Link a WhatsApp account to open-wa, keep it logged in, notice when it drops, and run several accounts.

Sessions and login

A session is one linked WhatsApp account, named by its sessionId. You link it once by scanning a QR code or typing a code on the phone, and open-wa saves the login so later starts reconnect without asking again. These pages cover the whole life of a session:

TaskPage
Link an account with a QR code, keep the login between restarts, and check that it's readyLog in and keep a session
Link without a camera, by typing a code on the phoneLink with a code
Watch startup, the QR code and state changes from codeSession events
Notice when the phone unlinks the session and alert someoneDetect logouts
Reload a running session or apply a license without restartingRefresh a session
Run several accounts side by sideMultiple sessions

Is my session ready?

The Easy API answers HTTP requests before WhatsApp has finished connecting, so check readiness before you send:

curl http://127.0.0.1:8080/health

Send only when the response has "connected": true and "session": { "ready": true, ... }. Until then, method calls return 503. In the SDK, create() resolves only once the session is ready, so you can send as soon as it returns.

Keep the saved login private: anyone who copies it can use the account. Go to production covers where to store it and how to back it up.

Was this helpful?

Your answer includes the page path and docs version.

On this page