Store a credential with a provider shortcut or a custom auth scheme, then rotate or delete it without touching your sandboxes.
A secret needs a name, a value (the real credential), and a way to authenticate — either a provider shortcut or a custom auth config. The value is encrypted on the platform and never returned by the API.
Built-in providers span LLM APIs, dev tools, and SaaS, and the list grows over time. Provider.list() returns the full current set — names, hosts, and token shape:
import { Provider } from "@superserve/sdk"const providers = await Provider.list()for (const p of providers) { console.log(p.name, p.hosts) // "anthropic" ["api.anthropic.com"]}
When there’s no shortcut, define the auth yourself with auth and hosts. auth and provider are mutually exclusive — pick one.The auth.type controls how the credential is attached to outbound requests:
type
Attaches as
bearer
Authorization: Bearer <value>
api-key
a named header — <header>: <prefix><value>
basic
HTTP Basic, <username>:<value>
custom
arbitrary header templates referencing {{ value }}
// One host, key sent in the Authorization header.await Secret.create({ name: "linear-key", value: "lin_api_...", hosts: ["api.linear.app"], auth: { type: "api-key", header: "Authorization" },})
hosts accepts wildcards (*.example.com), but not a whole top-level domain like *.com. A wildcard matches subdomains, not the domain itself — list both example.com and *.example.com if you need each.
Replace a secret’s value without recreating it. Bound sandboxes keep their environment variable; the new value is used on subsequent requests — no redeploy, no restart.
const secrets = await Secret.list()await Secret.deleteByName("openai-prod")// or, from an instance:await secret.delete()
Deleting a secret takes effect immediately, everywhere it’s bound — any sandbox still using it starts failing at once. The environment variable stays, but its stand-in token no longer works. If you only want to change the value, rotate instead.