Skip to main content
Use whatsappBusiness.config(...) with credentials from Meta for Developers.

Config

Each option falls back to its environment variable when omitted (an explicit value always wins). If you set both SPECTRUM_WHATSAPP_BUSINESS_ACCESS_TOKEN and SPECTRUM_WHATSAPP_BUSINESS_PHONE_NUMBER_ID, calling whatsappBusiness.config() with no arguments boots the provider in direct mode from the environment. A partial set (only one of the two) instead falls back to cloud mode, which uses your projectId/projectSecret. Find these values in your WhatsApp Business app settings on Meta for Developers.

Line discovery in cloud mode

Cloud mode discovers every line owned by the project from the credentials it mints, and re-mints them on a schedule. A line added to (or removed from) the project while your app is running is therefore picked up at the next token renewal, not immediately — until then a newly added line receives no inbound messages. Restart the process if you need a new line to take effect right away.

Example