Skip to content

FileLink

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