convex-invite
Getting started

Installation

Install convex-invite, mount the component, and construct the host client.

Install

From the host application workspace:

bun add convex-invite

Use the workspace package while developing this repository.

Mount the component

convex/convex.config.ts
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 dev

Multiple named mounts are isolated:

app.use(invite, { name: "customerInvites" });
app.use(invite, { name: "staffInvites" });

Create a host client

convex/invites.ts
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.

On this page