Skip to content

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).

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",
});
const apiKey = yield* Stripe.AppsSecret("third-party-api", {
name: "third-party-api",
payload: "sk_live_rotated",
scope: { type: "account" },
});
const oauth = yield* Stripe.AppsSecret("user-oauth", {
name: "oauth-token",
payload: "tok_example",
scope: { type: "user", user: "usr_123" },
});