> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Turbo secrets

> Store private keys for Turbo plugin transforms as turbo secrets with goldsky secret, and map them to plugin options with the secrets field.

Some Turbo plugins need a credential at runtime, for example the delegate key that [Zama decryption](https://docs.goldsky.com/turbo-pipelines/sources/zama-decrypted-transfers.md) uses to sign decryption permits. Store the credential as a secret of type `turbo`, then map it to a plugin option with the `secrets` field in your pipeline YAML.

> [!NOTE]
>
> Turbo secrets are for plugin options. Sink credentials (database, Kafka, S3, and others) use the other [secret types](https://docs.goldsky.com/turbo-pipelines/cli-reference.md#secrets) and the `secret_name` field. Turbo secrets do not appear in the sink secrets UI or in the interactive `goldsky secret create` prompt.

## Manage secrets

Turbo secrets use the standard `goldsky secret` commands. The value is JSON with `type` set to `turbo` and `value` set to the credential.

To create a secret:

```bash theme={"dark"}
goldsky secret create --name CUSTOM_SOURCE_SECRET \
  --value "{\"type\":\"turbo\",\"value\":\"$(cat delegate.key)\"}"
```

`CUSTOM_SOURCE_SECRET` is an example. Choose any name, and use the same name in the pipeline's `secrets` map.

> [!WARNING]
>
> A literal key in `--value` is saved in your shell history. Read it from a file with owner-only permissions, as above, instead of pasting it.

To change the value:

```bash theme={"dark"}
goldsky secret update CUSTOM_SOURCE_SECRET \
  --value "{\"type\":\"turbo\",\"value\":\"$(cat delegate.key)\"}"
```

`goldsky secret update` does not check the existing type. Make sure the name belongs to a turbo secret, and keep `"type":"turbo"` in the value: if you change the type, pipelines that map the secret fail to deploy.

To list secrets (the `Type` column shows `turbo`) and to remove one:

```bash theme={"dark"}
goldsky secret list
goldsky secret delete CUSTOM_SOURCE_SECRET
```

Goldsky reads the secret when it deploys the pipeline. A plain restart reuses the value from the last deploy. After you change a secret, redeploy each pipeline that uses it:

```bash theme={"dark"}
goldsky turbo restart PIPELINE_NAME --resync
```

Re-applying the pipeline with `goldsky turbo apply` also picks up the new value.

## Use a secret in a pipeline

Add a `secrets` map to a plugin source, transform, or sink, or to a dataset source that expands into one (such as [`zama.decrypted_transfers`](https://docs.goldsky.com/turbo-pipelines/sources/zama-decrypted-transfers#goldsky-turbo)). Each key is a plugin option; each value is the name of a secret. A turbo secret passes its value as is. A `jdbc` secret passes a Postgres connection URL, for plugins that take a database URL.

```yaml theme={"dark"}
sources:
  transfers:
    type: dataset
    dataset_name: zama.decrypted_transfers
    version: 1.0.0
    chain_id: 1
    secrets:
      delegate_private_key: CUSTOM_SOURCE_SECRET
      relayer_api_key: CUSTOM_API_KEY
```

At deploy time, Goldsky resolves each entry and passes the value to that plugin option. The secret value never appears in the pipeline definition.

The deploy fails if:

* A name in `secrets` is not a turbo or `jdbc` secret.
* `secrets` is not a map of option names to secret names.
* Two nodes of the same plugin type map the same option to different secrets. The plugin reads one environment variable per option, so a pipeline holds one value per type and option.

## Next steps

> [card] [Zama decrypted transfers](https://docs.goldsky.com/turbo-pipelines/sources/zama-decrypted-transfers.md)
>
> Stream ERC-7984 transfers with amounts decrypted by your delegate key.

> [card] [CLI reference](https://docs.goldsky.com/turbo-pipelines/cli-reference.md)
>
> All Turbo CLI commands.


## Related topics

- [Turbo CLI Reference](https://docs.goldsky.com/turbo-pipelines/cli-reference.md)
- [Zama decrypted transfers](https://docs.goldsky.com/turbo-pipelines/sources/zama-decrypted-transfers.md)
- [Secrets](https://docs.goldsky.com/platform/secrets.md)
- [Turbo - Supported sinks](https://docs.goldsky.com/turbo-pipelines/sinks/overview.md)
- [Migrate from Mirror to Turbo](https://docs.goldsky.com/turbo-pipelines/migrate-from-mirror.md)
