context.secrets when an invocation starts.
Use Secrets for values such as third-party API tokens, service credentials, and other sensitive configuration that should not live in Function code.
How secrets work
- The Browse CLI gets your project’s public key and encrypts the value on your machine.
- Browserbase stores the encrypted value and returns a secret ID.
- You attach the secret ID to a Function.
- Browserbase loads the attached value into
context.secretswhen an invocation starts.
process.env in a deployed invocation.
Access model
Secrets and Functions must belong to the same Browserbase project. Browserbase resolves the project from the API key used for each command or SDK request.
Secrets and invocation parameters
Use a secret for a sensitive value that a Function needs across invocations. Use invocation parameters for non-sensitive input that changes from one invocation to the next. For local development, use a local environment variable as a fallback. Function attachments apply only to deployed invocations.Next steps
Get started with secrets
Create, inspect, update, and delete a secret.
Use secrets in Functions
Attach a secret and read it from Function code.