convex-envelope-store
v0.1.0
Published
Generic JSON envelope records with tenant and collection partitioning for Convex
Maintainers
Readme
convex-envelope-store
Generic JSON documents partitioned by tenantId and collection.
Use it for catalogs, settings blobs, or any { recordId, data } record that
should not become a one-off table.
This is a Convex component. Call it from your app's queries and mutations. Do not expose these functions directly to clients.
Install
npm install convex-envelope-store// convex/convex.config.ts
import { defineApp } from "convex/server";
import envelopeStore from "convex-envelope-store/convex.config.js";
const app = defineApp();
app.use(envelopeStore);
export default app;await ctx.runMutation(components.envelopeStore.envelopes.upsert, {
collection: "catalog:items",
recordId: itemId,
slug: "my-item",
data: payload,
tenantId: orgId,
});Reads: get, getBySlug, list, listPage (paginated). Writes: upsert,
remove. tenantId defaults to "default".
