Skip to content
Pywa Cloud is not live yet - there is no running control plane or dashboard to sign up on, and the CLI package is not published. Everything on this site describes a real, working, tested system, not a roadmap - but none of it is something you can actually run against Pywa Cloud today, and commands/flags/behavior can still change before it is.

Environment Variables & Secrets

pywa itself never reads environment variables for you — your project’s own code reads them via os.environ and passes them to WhatsApp(...), exactly like every pywa example does:

import os
from pywa import WhatsApp
wa = WhatsApp(
phone_id=os.environ.get("PYWA_PHONE_ID"),
token=os.environ.get("PYWA_TOKEN"),
)

Pywa Cloud’s job is getting the values you set into your bot’s environment at deploy time — nothing more magical than that.

Terminal window
pywa cloud env set OPENAI_API_KEY "sk-..." --secret
pywa cloud env set LOG_LEVEL DEBUG

env set is create-or-update: if the key doesn’t exist yet, it’s created with whatever --secret flag you passed; if it already exists, only its value is updated.

Not instantly. Your bot picks up its environment once, when it starts — a running bot doesn’t re-read it, and restart doesn’t change that either, so env set/env delete change what the next real deploy will apply, not what’s running right now. Your bot is flagged as having pending changes the moment you change one — shown as a “Config changed” banner on the dashboard’s Overview tab — until you pywa deploy, or use the dashboard’s one-click Redeploy (applies your bot’s current config fresh, no new code needed).

The --secret designation is fixed the moment a key is first created, and can never change afterward — not by omitting --secret on a later env set, not any other way. If you try, the CLI updates the value but tells you the flag was ignored:

✅ Updated 'OPENAI_API_KEY' on my-bot (--secret ignored: the secret/plain designation is fixed at creation)

A secret value is never returned by any command or API call once set — not in env get, not in env list, not right after the env set that created it. If you lose it, there’s no way to retrieve it: delete the key and set it again.

A plain value is always readable back — useful for non-sensitive config like LOG_LEVEL, where seeing the current value is more useful than hiding it.

Terminal window
pywa cloud env list
pywa cloud env get OPENAI_API_KEY # → OPENAI_API_KEY=<secret, value not shown> (updated ...)
pywa cloud env get LOG_LEVEL # → LOG_LEVEL=DEBUG
pywa cloud env delete LOG_LEVEL

The dashboard’s Environment tab does the same create/update/delete, with one extra convenience the CLI doesn’t have: an optional “redeploy now” checkbox, so a config change can go live without a separate pywa deploy.

Secret values are encrypted at rest, and only ever decrypted at the moment they’re injected into your bot’s running environment — never in transit as plain text, never sitting in storage unencrypted, and never returned by the API or dashboard again once saved. See Security & Isolation for the full picture of what is and isn’t guaranteed around your bot’s data.