Skip to content

Stripe.Files reference

Source: src/Stripe/CreateFileLink.ts

Create a Stripe File Link over HTTP. Account-scoped — binds the API key onto the host, not a specific file link resource.

Section titled “CreateFileLink: Creating a File Link at runtime”
const create = yield* Stripe.CreateFileLink();
const link = yield* create({
file: "file_123",
});

Source: src/Stripe/CreateFileLinkHttp.ts Kind: Layer · Provides: Stripe.CreateFileLink

HTTP implementation of CreateFileLink. Provide it on the Function or Worker Effect.

Source: src/Stripe/FileLink.ts

A Stripe File Link — a public URL for a File that does not require Stripe authentication. file is create-only; changing it replaces the link. expiresAt and metadata update in place. Expired links cannot be updated. Destroy expires the link (expires_at: "now") rather than deleting it — Stripe has no file-link delete API.

Link a file

const link = yield* Stripe.FileLink("report", {
file: "file_123",
});

Expiring link with metadata

const link = yield* Stripe.FileLink("report", {
file: "file_123",
expiresAt: 1900000000,
metadata: { kind: "report" },
});
const link = yield* Stripe.FileLink("report", {
file: "file_123",
expiresAt: 1920000000,
metadata: { kind: "report", env: "prod" },
});
const link = yield* Stripe.FileLink("report", {
file: "file_123",
});
// stack.destroy() sets expires_at to now

Source: src/Stripe/RetrieveFileLink.ts

Retrieve a bound Stripe File Link over HTTP.

const retrieve = yield* Stripe.RetrieveFileLink(link);
const live = yield* retrieve();

Source: src/Stripe/RetrieveFileLinkHttp.ts Kind: Layer · Provides: Stripe.RetrieveFileLink

HTTP implementation of RetrieveFileLink. Provide it on the Function or Worker Effect.

Source: src/Stripe/UpdateFileLink.ts

Update a bound Stripe File Link over HTTP. Expired links cannot be updated.

const update = yield* Stripe.UpdateFileLink(link);
const live = yield* update({ expires_at: "now" });

Source: src/Stripe/UpdateFileLinkHttp.ts Kind: Layer · Provides: Stripe.UpdateFileLink

HTTP implementation of UpdateFileLink. Provide it on the Function or Worker Effect.