Skip to main content
Most Compose apps need some form of credential: an EOA private key, an auth token for an external service, etc. Compose handles both built-in smart wallets and arbitrary user-managed secrets.

Wallets

Many compose apps make blockchain transactions and need gas and payment funds to do so. By default, Compose makes you a smart wallet that lets you pay gas fees in fiat as part of your normal monthly Goldsky bill, which keeps accounting in USD for teams that aren’t “blockchain-native”. You can fund these smart wallets with any tokens your business logic requires (by default Goldsky will pay gas fees if you haven’t funded the wallet yourself). Goldsky hosted wallets are created dynamically and idempotently in your app code, so wallet creation can use any logic. For specifics see Context. Sometimes a specific EOA wallet is needed for specific transactions, such as owner-only contract methods. In those cases, store your private key in a secret. See below for details.
To fund your built-in smart wallet (beyond Goldsky’s default gas-sponsorship behavior), you can retrieve its public key from the compose Dashboard at app.goldsky.com. See monitoring for details.

Examples

Secrets

Compose secrets are scoped to a specific Compose app within your Goldsky project. You can set or update secrets at any time using the CLI, but a running app will only pick up new secret values after a redeploy. This protects running apps from accidental changes and lets you roll forward (or back) safely by pairing a deploy with the secrets it expects. The way secrets are managed in the cloud vs locally is slightly different.
Secret names must be in SCREAMING_SNAKE_CASE: all uppercase letters, digits, and underscores, starting with a letter (e.g. MY_SECRET, API_KEY_V2).

Manage Secrets for Local Dev

In local dev, you’ll put your secrets in your .env file. Every compose app created with goldsky compose init comes with a gitignored .env file by default.
.env

Manage Secrets for Cloud

To add or update a secret in the cloud:
To update a secret and immediately redeploy so the app picks it up:
To remove a cloud secret:
To list all secrets for the app:
You can also write secrets into your local .env with the same command by adding --env local:

How secrets are stored

Cloud secrets are end-to-end encrypted. When you run goldsky compose secret set, the CLI encrypts the value on your machine with your project’s public key before uploading it, so the value is never sent or stored in plaintext. There is no way to read a secret value back: not from the CLI, not from the dashboard, and not by Goldsky. goldsky compose secret list shows secret names only. A secret is decrypted only inside your running app, where it appears on ctx.env. To rotate a secret, set a new value. The previous value is never displayed, and the dashboard secrets page shows names, not values.
If a secret value would appear in a task run’s trace output, it is redacted in the dashboard. That is intended behavior, not data loss.

Syncing .env to the cloud at deploy

If you’ve been developing locally with secrets in your .env file, compose deploy --sync-env uploads every entry from your .env as a cloud secret before deploying. This is a convenient way to push a whole app’s secrets in one step.
A running app only picks up new secret values after a redeploy. Use --redeploy on secret set, or run goldsky compose deploy yourself.

Using Secrets

For secrets to be injected into your app at runtime, they have to be listed in the secrets: section of the manifest. Only secrets named in the manifest of the currently-deployed version are made available to your tasks, so older deploys keep working even as you add, rename, or remove secrets for newer ones.
compose.yaml
Inside a task, each secret is exposed on ctx.env under its exact name:

Next Steps

App configuration

Configure your app manifest, tasks, and secrets.

Deploying and monitoring

Deploy your app and monitor it in the cloud.