Skip to main content

Vaults overview

A vault is a scoped container attached to a single payment. When vaultMiddleware runs on a request with a valid payment, it creates a vault and attaches it to req.vault. Your handler writes results into the vault and seals it when done. The caller retrieves results by reading vault contents.

Vault states

Using vaultMiddleware

vaultMiddleware creates the vault automatically. Add it after payMiddleware in your middleware chain:

Vault object methods

Sub-pages

Create a vault

Vault creation options and manual creation without middleware.

Access control

Vault access tokens for sharing read access.

Seal a vault

Mark work complete and close a vault for writes.

Persist a vault

Extend vault lifetime beyond its TTL.

Query vaults

List and filter vault records.

TTL and expiry

How TTL works and how to extend it.

Delete a vault

Explicitly delete a vault and free quota.

Vault quota

Monitor active and persisted vault counts against plan limits.