Secrets
secrets
Methods
Creates a new secret for a project.
Use this method to:
- Store sensitive configuration values
- Set up environment variables
- Configure registry authentication
- Add file-based secrets
Examples
Create environment variable:
Creates a secret that will be available as an environment variable.
name: "DATABASE_URL" projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" value: "postgresql://user:pass@localhost:5432/db" environmentVariable: true
Create file secret:
Creates a secret that will be mounted as a file.
name: "SSH_KEY" projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" value: "-----BEGIN RSA PRIVATE KEY-----\n..." filePath: "/home/gitpod/.ssh/id_rsa"
Create registry auth:
Creates credentials for private container registry.
name: "DOCKER_AUTH" projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" value: "username:password" containerRegistryBasicAuthHost: "https://registry.example.com"
Deletes a secret permanently.
Use this method to:
- Remove unused secrets
- Clean up old credentials
Examples
Delete secret:
Permanently removes a secret.
secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
Gets the value of a secret. Only available to environments that are authorized to access the secret.
Use this method to:
- Retrieve secret values
- Access credentials
Examples
Get secret value:
Retrieves the value of a specific secret.
secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
Lists secrets with optional filtering.
Use this method to:
- View all project secrets
- Filter secrets by project
Examples
List project secrets:
Shows all secrets for a project.
filter: projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] pagination: pageSize: 20
pagination contains the pagination options for listing secrets
Updates the value of an existing secret.
Use this method to:
- Rotate secret values
- Update credentials
Examples
Update secret value:
Changes the value of an existing secret.
secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" value: "new-secret-value"
Domain types