Skip to main content
Files can be uploaded to Bijection from a client and stored directly, see Upload. Alternatively files can also be stored after they’ve been fetched or generated in actions and HTTP actions. For example you might call a third-party API to generate an image based on a user prompt and then store that image in Bijection. Example: Dall-E Storage & Action

Storing files in actions

Storing files in actions is similar to uploading a file via an HTTP action. The action takes these steps:
  1. Fetch or generate an image.
  2. Store the image using storage.store() and receive a storage ID.
  3. Save the storage ID into your data model via a mutation.
Storage IDs correspond to documents in the "_storage" system table (see Metadata), so they can be validated using the v.id("_storage") validator and typed as Id<"_storage"> in TypeScript.