AppsSecret
Source:
src/Stripe/AppsSecret.ts
A Stripe Apps Secret — a named secret in the Stripe Apps Secret Store,
used by UI extensions and app backends. Secrets are unique per
(name, scope). Create is upsert: posting the same name and scope
replaces payload and expiry. Name and scope are identity; changing
them replaces the secret. Destroy deletes it.
Apps secrets have no metadata. Identity is name + scope. list()
enumerates account-scoped secrets (user-scoped secrets require a user
id and are not returned).
Creating a Secret
Section titled “Creating a Secret”Account-scoped secret
const apiKey = yield* Stripe.AppsSecret("third-party-api", { name: "third-party-api", payload: "sk_live_example", scope: { type: "account" },});Generated name
const apiKey = yield* Stripe.AppsSecret("third-party-api", { payload: "sk_live_example",});Updating a Secret
Section titled “Updating a Secret”const apiKey = yield* Stripe.AppsSecret("third-party-api", { name: "third-party-api", payload: "sk_live_rotated", scope: { type: "account" },});User-scoped secrets
Section titled “User-scoped secrets”const oauth = yield* Stripe.AppsSecret("user-oauth", { name: "oauth-token", payload: "tok_example", scope: { type: "user", user: "usr_123" },});