examples/ folder contains runnable server examples. They use environment variables, never load the project’s private environment, and do not contact a real service merely by being imported. Run them only against a reviewed installation and selected conversations.
Node or Python status check
node examples/node/messages.mjs and python3 examples/python/status.py perform a read-only status request. They require your HTTPS installation origin and a key with status:read. The Python example uses the standard library; it is not a published Python SDK.
Groups and direct messages
Use exact chat IDs returned by permitted API reads. A group ends in@g.us; a DM can use a phone or verified LID ID. Do not derive an alias from a visible phone number, strip suffixes, or accept a model’s invented recipient.
examples/node/agent-worker.mjs supplies starter orchestration over the same customer SDK:
- Durably receive a signed event using the receiver.
- Call
prepare(eventId)to fetch authorized history and run your own decision function. - Review the draft. A separate host callback must authorize
sendApproved(eventId). - Persist the result. Accepted means engine acceptance; unknown work remains locked.
- Call
inspect(eventId)with the original key to read operation state without resubmitting.
Reply, attach and react
--send opts into a reviewed text/reply/PDF action.