Skip to main content

Reading

The StorageReader service is used to retrieve the URLs of blobs in storage.
import { Effect } from "effect";
import { StorageReader } from "./confect/_generated/services";

Effect.gen(function* () {
  const reader = yield* StorageReader;

  return yield* reader.getUrl(storageId);
});

Writing in mutations

The StorageWriter service is used to write blobs to storage in mutations.
Effect.gen(function* () {
  const storage = yield* StorageWriter;

  // ...
});

Methods

Generate an upload URL

storage.generateUploadUrl();

Delete a blob

storage.delete(storageId);

Writing in actions

The StorageActionWriter service is used to read and write blobs to storage in actions.
Effect.gen(function* () {
  const storage = yield* StorageActionWriter;

  // ...
});

Methods

Get a blob

storage.get(storageId);

Store a blob

storage.store(blob, { sha256: optionalHash });