pb.invites
Send email invites and work with referrals before an account is created.
This resource has two related flows. Email invitation methods are for signed-in Packbase users. Waitlist referral methods operate before a Packbase account exists. These methods identify the person with a Clerk waitlist entry ID.
Email invitations
const = await ..()
const = await ..('person@example.com')
.(., .)list() returns invitations that the current user created. generate(email) asks Clerk to send an invitation email. It does not return a shareable invite code.
Both methods use the Invite shape:
interface Invite {
invite_id: string
created_at: string
[key: string]: JsonValue
}Invitation providers may add JSON fields beyond the two stable keys. Render recognized fields deliberately and retain a generic JSON fallback for additional record data.
Get a waitlist referral
const = await ..()
.(.)
.(., .)This gets referral information for one Clerk waitlist entry. On the first request, the server also creates an eight-character referral code.
interface WaitlistReferral {
code: string
url: string
referrals: number
priority: number
referred_by?: string
}Treat the Clerk waitlist ID as sensitive because it identifies a pre-signup entry. Locked, rejected, completed, or unknown entries cannot use this endpoint.
Redeem a waitlist referral
const = await ..(, 'ABCD1234')
.(.)The waitlistId identifies the person who redeems the code. The second argument is the referrer's code. Codes are case-insensitive and contain a maximum of eight characters. A person can redeem a code only one time. The server rejects self-referrals.