Getting started
Installation
Install convex-invite, mount the component, and construct the host client.
Install
From the host application workspace:
bun add convex-inviteUse the workspace package while developing this repository.
Mount the component
import { defineApp } from "convex/server";
import invite from "convex-invite/convex.config.js";
const app = defineApp();
app.use(invite);
export default app;Run Convex code generation after mounting:
bunx convex devMultiple named mounts are isolated:
app.use(invite, { name: "customerInvites" });
app.use(invite, { name: "staffInvites" });Create a host client
import { Invitations } from "convex-invite";
import { components } from "./_generated/api";
const invites = new Invitations(components.invite, {
ttlMs: 7 * 24 * 60 * 60 * 1000,
terminalRetentionMs: 90 * 24 * 60 * 60 * 1000,
});The optional roleParser, payloadParser, and acceptanceResultParser
callbacks can validate application values before they cross the component
boundary. The component also enforces JSON depth, key-count, and size limits.
Next step
Do not export component calls directly. Continue with the complete host example to add authentication, delivery, and atomic membership creation.