[ CONVEX COMPONENT · STABLE · MIT ]
@vllnt/convex-invitations
Invite → accept → expire flow — issue a single-use, expiring invitation to a resource and consume it
STABLE 0.1.0 · 1 GitHub star
Package details
Install
The untagged install gets the latest stable version (0.1.0). The canary tag tracks main (0.1.1-canary.77bc1a4).
pnpm add @vllnt/convex-invitations
pnpm add @vllnt/convex-invitations@canaryRegister the component
Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.
import { defineApp } from "convex/server";
import invitations from "@vllnt/convex-invitations/convex.config";
const app = defineApp();
app.use(invitations);
export default app;Use it
Usage, options and examples are in the package README.
Downloads
- Last 7 days
- 23
- Since first publish
- 1,939
Downloads per week since 14 June 2026, oldest on the left. Weeks count back from 23 November 2026, so the first one may be shorter than seven days.
23 downloads in the last 7 days. 1,939 downloads since 14 June 2026. Source: npm, counted through 23 November 2026.
Show downloads per week as a table
| Week | Downloads |
|---|---|
| 14 June 2026 to 15 June 2026 | 141 |
| 16 June 2026 to 22 June 2026 | 395 |
| 23 June 2026 to 29 June 2026 | 37 |
| 30 June 2026 to 6 July 2026 | 57 |
| 7 July 2026 to 13 July 2026 | 62 |
| 14 July 2026 to 20 July 2026 | 23 |
| 21 July 2026 to 27 July 2026 | 7 |
| 28 July 2026 to 3 August 2026 | 3 |
| 4 August 2026 to 10 August 2026 | 11 |
| 11 August 2026 to 17 August 2026 | 64 |
| 18 August 2026 to 24 August 2026 | 16 |
| 25 August 2026 to 31 August 2026 | 335 |
| 1 September 2026 to 7 September 2026 | 361 |
| 8 September 2026 to 14 September 2026 | 53 |
| 15 September 2026 to 21 September 2026 | 12 |
| 22 September 2026 to 28 September 2026 | 11 |
| 29 September 2026 to 5 October 2026 | 5 |
| 6 October 2026 to 12 October 2026 | 18 |
| 13 October 2026 to 19 October 2026 | 9 |
| 20 October 2026 to 26 October 2026 | 6 |
| 27 October 2026 to 2 November 2026 | 192 |
| 3 November 2026 to 9 November 2026 | 78 |
| 10 November 2026 to 16 November 2026 | 20 |
| 17 November 2026 to 23 November 2026 | 23 |
Release history
Every release on a timeline, oldest on the left. A tall mark with its version is a stable release; a short mark is a canary build. The time axis is the one of the downloads chart, so a release stands above the week it shipped in.
1 stable release and 9 canary builds since 14 June 2026. Latest stable: 0.1.0 on 1 September 2026.
Show every release as a table
| Version | Kind | Published |
|---|---|---|
| 0.1.1-canary.77bc1a4 | canary | 31 October 2026 |
| 0.1.0 | stable | 1 September 2026 |
| 0.1.0-canary.ebbf6c4 | canary | 1 September 2026 |
| 0.1.0-canary.01d468e | canary | 31 August 2026 |
| 0.1.0-canary.85e7a34 | canary | 31 August 2026 |
| 0.1.0-canary.a9f2818 | canary | 31 August 2026 |
| 0.1.0-canary.7ff4031 | canary | 16 June 2026 |
| 0.1.0-canary.d3aaf07 | canary | 16 June 2026 |
| 0.1.0-canary.26bf80f | canary | 16 June 2026 |
| 0.1.0-canary.0e3e39d | canary | 14 June 2026 |
Changelog
The newest stable releases of @vllnt/convex-invitations, with the notes from its changelog.
0.1.0
Added
- First release of
@vllnt/convex-invitations— the invite → accept → expire flow as a Convex component. issue(resourceRef, { role?, inviterRef?, inviteeRef?, payload?, ttlMs?, expiresAt? })records apendinginvitation and returns its single-usetoken(to deliver out of band) plus its absoluteexpiresAt; the token must be unique.accept(token, acceptedBy)consumes the invite (single-use,pending → accepted) and returns the grant (resourceRef+ opaquerole/payload) the host applies; two racing accepts yield exactly one winner.revoke(token)cancels a still-pendinginvite;peek(token)reads with read-time TTL enforcement (flips a stale pending invite toexpired);getByToken(token)is a pure reactive read;listPending(resourceRef, paginationOpts)andlistByResourceStatepage an org's invites.- Single-use + terminal states are final: accepting or revoking an
accepted/revoked/expiredinvite is rejected with a codedConvexError, so a replayed link can never double-grant. - TTL enforced on read: accepting a past-
expiresAtinvite is rejected withEXPIRED(a thrown accept does not persist a flip —peek/the cron sweeppending → expiredinstead). - Server-sourced time: every handler stamps
createdAt/acceptedAt/revokedAtfromDate.now()inside the mutation — no caller-supplied clock. - Typed generics:
Invitations<TRole, TPayload>with optionalroleValidator/payloadValidatorhost parsers narrowing the opaque storedrole/payloadat the client boundary on write and read — nov.any()dump, no unchecked cast. ConfigurablettlMsandgenerateToken. - Bounded, self-rescheduling
prune(retention delete of terminal invites + TTL sweep of stale pending invites) plus a built-in daily prune cron (crons.ts); idempotent. Default TTL 7 days, default retention 30 days. - Mount-safe: correct under multiple
app.use(component, { name })mounts — each instance is sandboxed, the cron is registered per instance. - Minimal stage: the invite (including its token) is modelled self-contained; a
later version delegates the hashed token to
@vllnt/convex-tokensand the granted membership to@vllnt/convex-memberships.
Breaking
- Pending/history list pages now return token-free
InvitationMetadataprojections. Consumers that previously readpage[].tokenmust retain the one-timeissue()result for delivery and usepeek(token)/getByToken(token)for direct token lookup.
Fixed
- Apply the documented 30-day default retention window to terminal invitations instead of deleting them on the next daily sweep.
- Reject invalid prune batch sizes to prevent infinite self-scheduling and oversized transactions.
- Store only SHA-256 invitation-token digests and remove bearer tokens from pending/history list projections; raw tokens are returned only when issued and accepted only for direct lookup.
- Migrate pre-upgrade raw bearer tokens opportunistically on mutation and through a bounded daily backfill while preserving direct lookup and duplicate detection during the transition.
Changed
- Treat Convex
_generatedoutput as CLI-owned, exclude it from formatting, and expose a dedicated codegen script. - Refresh all direct dependencies to their latest compatible releases for canary validation.
- Require
convex@^1.45.0and updateconvex-testto^0.0.56.
- First release of
Licence
Released under the MIT licence. The full text is in the source repository.
[ PACKAGE ]
- Stable
- 0.1.0
- Canary
- 0.1.1-canary.77bc1a4
- GitHub stars
- 1 GitHub star
- Licence
- MIT
- Issues
- Open an issue