Environments
Every Cavos app has a development and a production environment. Select one from the SDK with the `environment` option.
Every app in the Cavos console has two environments for the embedded wallet (embedded wallets, embedded wallet SDK), created automatically the moment the app is created:
production: real traffic. This is the default the SDK uses when you don't pass anenvironment.development: building and testing, isolated from production.
You keep one appId and switch environments with a single flag. There is no
separate app to create.
What each environment isolates
The two environments share the app's identity but keep their operational state apart:
- Sponsorship / gas pool: each environment meters its own relayer balance and low-balance alerts, so test traffic never drains your production gas.
- API keys: server credentials are issued per environment.
- Events & webhooks: the event stream and webhook subscriptions are scoped per environment, so your development integration doesn't fire production hooks.
- Social recovery: enable or disable hardware-isolated recovery for Starknet, Solana, and Stellar wallets in that environment. Google, Apple, email, GitHub, and Telegram are all accepted; each wallet recovers through the provider its owner signed in with. Register your own Google or Apple OAuth client ID if you authenticate users yourself. GitHub needs no OAuth client ID here; its OAuth app is set under GitHub sign-in and its Telegram bot under Telegram sign-in (next items). All settings are independent per environment, so you can rehearse recovery in development without touching production. The email provider's "Firebase project ID" field no longer affects email sign-in codes, which the enclave issues itself.
- GitHub sign-in: leave empty to use Cavos's GitHub app, or save your own OAuth app's client ID and client secret so GitHub's consent screen shows your app. Switching apps gives every GitHub user in that environment a new identity and a new, empty wallet. See Authentication → GitHub.
- Telegram sign-in: leave empty to use Cavos's Telegram bot, or save your own Bot ID and Client Secret so Telegram's consent screen shows your bot name and avatar. Use the OIDC Client Secret from @BotFather, not the Bot API token. Switching bots gives every Telegram user in that environment a new identity and a new, empty wallet. See Authentication → Telegram.
Callback URLs and allowed web origins are per app, not per environment. Both live in Dashboard → App → Settings. A URL you add so a tunnel works in development is accepted in production too, because OAuth validates the redirect against the app's list before an environment is in play. Remove throwaway tunnel and preview domains once you are done with them. See Authentication.
Select it from the SDK
Pass environment to Cavos.connect (or to the provider config). Omit it and the
SDK uses production.
const wallet = await Cavos.connect({
chains: ["stellar"],
network: "testnet",
appId: process.env.CAVOS_APP_ID!,
appSalt: "my-app",
identity,
environment: process.env.NODE_ENV === "production" ? "production" : "development",
});With the React or React Native provider, set it once on the config:
<CavosProvider config={{
appId: process.env.EXPO_PUBLIC_CAVOS_APP_ID!,
appSalt: "my-app",
chain: "stellar",
network: "testnet",
redirectUri: "myapp://auth",
rpId: "auth.example.com",
environment: __DEV__ ? "development" : "production",
}}>
{children}
</CavosProvider>environment (the Cavos console environment) is independent of network
(testnet / mainnet). A development environment can point at mainnet, and
production at testnet; they answer different questions: whose gas and config
vs. which chain.
Wallet addresses across environments
The wallet address does not depend on the Cavos console environment flag.
Addresses come from the registry, keyed by identity, app, chain, and network.
If you want a user's development wallet to be a different address than their
production wallet, you need a distinct registry key, which means a separate
app (distinct appId). One appId shared across development and production
shares the registry address.
A distinct appSalt isolates the local device-key slot. It is also the HKDF
salt for the account key on every chain, so changing it after users have
connected derives a key that will not match the registry address.
Treat appSalt as permanent. Decide your salt before onboarding real users.