Start here
Live Mode vs Test Mode
Choose between the Simulator, Yanola Sandbox, and Live delivery modes without mixing Test and Live data.
What this guide covers
- Test Mode contains both the synthetic Simulator and the real-provider Yanola Sandbox.
- Sandbox restricts delivery to one consented participant and keeps its events on Test webhook endpoints.
- Live Mode sends real messages and enforces subscription, balance, and WhatsApp rules.
- Messages, events, API keys, and webhook endpoints remain separated by environment.
The API key selects the mode
Test Mode and Live Mode use the same @yanola/whatsapp methods, REST /v1 endpoints, schemas, scopes, and error envelopes. The credential prefix selects one environment for the entire request. Test Mode validates the Yanola integration and creates synthetic logs and webhook events; it never sends a WhatsApp message or calls Meta.
import { WhatsAppClient } from "@yanola/whatsapp"
const yanola = new WhatsAppClient({
apiKey: process.env.YANOLA_API_KEY!,
})
// yalo_test_... runs in Test Mode.
// yalo_live_... runs in Live Mode.Do not send environment in a message body to switch modes. Public reads and writes inherit the environment from YANOLA_API_KEY and cannot cross into the other environment.
Simulator, Sandbox, and Live compared
| Behavior | Simulator | Sandbox | Live |
|---|---|---|---|
Credential | yalo_test_... | yalo_test_... | yalo_live_... |
Sender | Connected customer Sender | Logical Yanola Sandbox grant | Connected customer Sender |
Delivery mode | simulated | sandbox | live |
Provider API call | Never | Yes, when provider availability is enabled | Yes, for accepted live sends |
Recipient | Schema-valid test value | One active consented participant | Authorized customer recipient |
Customer Service Window | Not required | Required for service message types | Required for non-template sends |
Templates | Validated synthetically | templates are not supported | Approved templates supported |
Webhooks | Test webhook endpoints | Test webhook endpoints | Live endpoints only |
Retention | Test retention policy | Content retained for at most seven days | Account entitlement |
Activate Yanola Sandbox
Yanola Sandbox is a real-provider Test Mode path. Accept the current disclosure, select the participant country, issue the one-time JOIN code, and have that participant send JOIN to the displayed Yanola number. The code and credentials are shown only for activation and are never placed in events or logs.
A Sandbox session can be pending, active, expired, stopped, replaced, disconnected, revoked, or provider-disabled. Use reconnect to continue the project conversation after a terminal session; Yanola does not silently reactivate an old participant.
- Send only text, image, video, document, audio, location, or contact-card service messages while the Customer Service Window is open.
- Do not send templates: templates are not supported in Sandbox.
- Budget at most 100 provider attempts per quota window. Failed provider attempts still count; sandbox_quota_exhausted reports the reset time.
- Expect normal workflow execution, including external workflow side effects. Sandbox changes delivery routing, not workflow semantics.
- Consume Sandbox lifecycle events only from Test webhook endpoints. deliveryMode remains sandbox when a failed delivery is replayed.
Sandbox activation and delivery depend on provider availability, country policy, Yanola capacity, abuse controls, and project eligibility. A visible logical grant does not promise that provider delivery is currently enabled.
What Test Mode validates
Test Mode is a production-shaped API simulator, not proof of WhatsApp delivery. It is designed to find Yanola request, authentication, logging, and webhook integration mistakes before a real send. Each Agent Project may keep one active Test key and make up to 1,000 simulated sends per 31-day quota window, with a maximum of 30 per minute per key.
- API key validity, Agent Project scope, subscription entitlement, and required scopes.
- Request schema, E.164 phone numbers, supported message fields, and idempotency behavior.
- Ownership, connection state, API eligibility, and optional key restriction for the from Sender.
- Rate limits and same-environment access for reads, events, webhooks, and logs.
What Test Mode skips
- Provider token access and provider API calls.
- Yanola Balance reservation, deduction, and provider pricing reconciliation.
- Provider-linked WhatsApp message persistence and real recipient delivery.
- The live Customer Service Window requirement for non-template sends.
Test Mode does not send from the number, but it verifies that the from number is connected, enabled, API-eligible, and available to the key's Agent Project.
Environment-isolated resources
Keys, messages, events, webhook endpoints, deliveries, idempotency records, rate-limit buckets, logs, and usage records are isolated by environment.
A Test Mode key cannot retrieve a live msg_ identifier, deliver to a live webhook endpoint, or replay an event into Live Mode. The same restrictions apply in reverse.
Move from Test Mode to Live Mode
The client methods and REST paths stay the same. Production readiness is a credential and operational change, not an SDK rewrite.
- Confirm the account subscription permits Live Mode and that Yanola Balance is available.
- Verify the production Sender is connected and API-eligible.
- Create a least-privilege Live Mode key and store it as YANOLA_API_KEY in the production secret manager.
- Create separate Live Mode webhook endpoints; test endpoints never receive live events.
- Use approved templates outside the 24-hour Customer Service Window.
- Run a controlled live send and monitor its message, event, webhook, and usage records.
Recommended environment mapping
| Application | Yanola credential | Webhook destination |
|---|---|---|
Local development | Test Mode key | Test endpoint on an HTTPS tunnel (cloudflared or ngrok) to your local receiver |
CI and automated tests | Dedicated Test Mode key with narrow scopes | Isolated test receiver |
Staging | Separate Test Mode key | Staging Test Mode endpoint |
Production | Live Mode key | Public HTTPS Live Mode endpoint |