client.vault.set
Store a new vault secret.
Signature
class Client {
vault: {
set(projectId: string, name: string, value: string): Promise<{ stored: boolean; name: string }>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| | yes | Project ID |
| | yes | Secret name (alphanumeric + underscore) |
| | yes | Secret value |
Examples
import { Client } from '@blueforge/client'
const bf = new Client({ apiKey: process.env.BF_API_KEY!, url: 'https://your-project.blueforge.dev' })
await bf.vault.set('proj_abc', 'API_KEY', 'sk-...')
Throws
| Error | Condition |
|---|---|
| API request failed |
| Network issue |
Pitfalls
- Idempotent overwrite — if a secret with the same name already exists, it is silently overwritten with the new value (no warning)
- Case-sensitive — secret names are case-sensitive;
andAPI_KEY
are distinct entriesapi_key - Name constraints — only alphanumeric characters and underscores are allowed in secret names
- Value size — secret values may be subject to a size limit (check your plan's documentation)
See also
{auto-injected}
Tested against
{auto-injected}