Skip to content

[ 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).

terminal
pnpm add @vllnt/convex-invitations
pnpm add @vllnt/convex-invitations@canary

Register the component

Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.

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

Read the 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
WeekDownloads
14 June 2026 to 15 June 2026141
16 June 2026 to 22 June 2026395
23 June 2026 to 29 June 202637
30 June 2026 to 6 July 202657
7 July 2026 to 13 July 202662
14 July 2026 to 20 July 202623
21 July 2026 to 27 July 20267
28 July 2026 to 3 August 20263
4 August 2026 to 10 August 202611
11 August 2026 to 17 August 202664
18 August 2026 to 24 August 202616
25 August 2026 to 31 August 2026335
1 September 2026 to 7 September 2026361
8 September 2026 to 14 September 202653
15 September 2026 to 21 September 202612
22 September 2026 to 28 September 202611
29 September 2026 to 5 October 20265
6 October 2026 to 12 October 202618
13 October 2026 to 19 October 20269
20 October 2026 to 26 October 20266
27 October 2026 to 2 November 2026192
3 November 2026 to 9 November 202678
10 November 2026 to 16 November 202620
17 November 2026 to 23 November 202623

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
VersionKindPublished
0.1.1-canary.77bc1a4canary31 October 2026
0.1.0stable1 September 2026
0.1.0-canary.ebbf6c4canary1 September 2026
0.1.0-canary.01d468ecanary31 August 2026
0.1.0-canary.85e7a34canary31 August 2026
0.1.0-canary.a9f2818canary31 August 2026
0.1.0-canary.7ff4031canary16 June 2026
0.1.0-canary.d3aaf07canary16 June 2026
0.1.0-canary.26bf80fcanary16 June 2026
0.1.0-canary.0e3e39dcanary14 June 2026

Changelog

The newest stable releases of @vllnt/convex-invitations, with the notes from its changelog.

  1. 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 a pending invitation and returns its single-use token (to deliver out of band) plus its absolute expiresAt; the token must be unique.
    • accept(token, acceptedBy) consumes the invite (single-use, pending → accepted) and returns the grant (resourceRef + opaque role/payload) the host applies; two racing accepts yield exactly one winner.
    • revoke(token) cancels a still-pending invite; peek(token) reads with read-time TTL enforcement (flips a stale pending invite to expired); getByToken(token) is a pure reactive read; listPending(resourceRef, paginationOpts) and listByResourceState page an org's invites.
    • Single-use + terminal states are final: accepting or revoking an accepted/ revoked/expired invite is rejected with a coded ConvexError, so a replayed link can never double-grant.
    • TTL enforced on read: accepting a past-expiresAt invite is rejected with EXPIRED (a thrown accept does not persist a flip — peek/the cron sweep pending → expired instead).
    • Server-sourced time: every handler stamps createdAt/acceptedAt/revokedAt from Date.now() inside the mutation — no caller-supplied clock.
    • Typed generics: Invitations<TRole, TPayload> with optional roleValidator / payloadValidator host parsers narrowing the opaque stored role/payload at the client boundary on write and read — no v.any() dump, no unchecked cast. Configurable ttlMs and generateToken.
    • 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-tokens and the granted membership to @vllnt/convex-memberships.
    Breaking
    • Pending/history list pages now return token-free InvitationMetadata projections. Consumers that previously read page[].token must retain the one-time issue() result for delivery and use peek(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 _generated output 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.0 and update convex-test to ^0.0.56.
All releases of @vllnt/convex-invitations
Stable releases
RSSAtomJSON Feed
Canary builds
RSSAtomJSON Feed

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

Theme