0.0.7 • Published 9 months ago

next-invite v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

📮 next-invite

A drop-in invite system for your Next.js app. Generate and share invite links for users to join your app.

Check out this example of a Next.js codebase showcasing an advanced implementation of next-invite.

🚧 Under active development. Expect breaking changes until v1.0.0.

📡 Install

npm install next-invite

yarn add next-invite

pnpm add next-invite

👋 Hello there! Follow me @linesofcode or visit linesofcode.dev for more cool projects like this one.

🚀 Getting Started

🧳 Storage

🔺 Upstash

☔️ Drizzle

🐘 DrizzlePgStore - Postgres

:wrench: Constants

:gear: zInvite

ConstantType
zInviteZodObject<{ id: ZodString; email: ZodNullable<ZodOptional<ZodString>>; code: ZodString; expires: ZodNullable<ZodOptional<ZodNumber>>; ... 7 more ...; uses: ZodNullable<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zDeleteInviteArgs

ConstantType
zDeleteInviteArgsZodObject<{ id: ZodString; }, "strip", ZodTypeAny, { id?: string; }, { id?: string; }>

:gear: zGetInviteArgs

ConstantType
zGetInviteArgsZodObject<{ id: ZodString; }, "strip", ZodTypeAny, { id?: string; }, { id?: string; }>

:gear: zFindInviteArgs

ConstantType
zFindInviteArgsZodObject<{ email: ZodNullable<ZodOptional<ZodString>>; code: ZodString; }, "strip", ZodTypeAny, { email?: string; code?: string; }, { ...; }>

:gear: zCreateInviteArgs

ConstantType
zCreateInviteArgsZodObject<{ id: ZodNullable<ZodOptional<ZodString>>; email: ZodNullable<ZodOptional<ZodString>>; expires: ZodNullable<...>; data: ZodNullable<...>; unlimited: ZodOptional<...>; total: ZodNullable<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zInvalidateInviteArgs

ConstantType
zInvalidateInviteArgsZodObject<{ id: ZodString; }, "strip", ZodTypeAny, { id?: string; }, { id?: string; }>

:gear: zUseInviteArgs

ConstantType
zUseInviteArgsZodObject<{ code: ZodString; email: ZodNullable<ZodOptional<ZodString>>; data: ZodNullable<ZodOptional<ZodAny>>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zLogInviteUseArgs

ConstantType
zLogInviteUseArgsZodObject<{ id: ZodString; inviteId: ZodString; email: ZodNullable<ZodOptional<ZodString>>; data: ZodNullable<ZodOptional<ZodAny>>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zInviteLog

ConstantType
zInviteLogZodObject<{ id: ZodString; inviteId: ZodNullable<ZodOptional<ZodString>>; email: ZodNullable<ZodOptional<ZodString>>; data: ZodNullable<...>; createdAt: ZodUnion<...>; updatedAt: ZodUnion<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zBaseFilterArgs

ConstantType
zBaseFilterArgsZodObject<{ limit: ZodNullable<ZodOptional<ZodNumber>>; offset: ZodNullable<ZodOptional<ZodNumber>>; all: ZodNullable<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zFilterInvitesArgs

ConstantType
zFilterInvitesArgsZodObject<{ limit: ZodNullable<ZodOptional<ZodNumber>>; offset: ZodNullable<ZodOptional<ZodNumber>>; all: ZodNullable<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zFilterInviteLogsArgs

ConstantType
zFilterInviteLogsArgsZodObject<{ limit: ZodNullable<ZodOptional<ZodNumber>>; offset: ZodNullable<ZodOptional<ZodNumber>>; all: ZodNullable<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

:gear: zDeleteInviteLogArgs

ConstantType
zDeleteInviteLogArgsZodObject<{ id: ZodString; }, "strip", ZodTypeAny, { id?: string; }, { id?: string; }>

:gear: zGetInviteLogArgs

ConstantType
zGetInviteLogArgsZodObject<{ id: ZodString; }, "strip", ZodTypeAny, { id?: string; }, { id?: string; }>

:factory: NextInvite

Methods

:gear: createInvite

MethodType
createInvite(args: any) => Promise<{ invite: { id?: string; email?: string; code?: string; expires?: number; data?: any; createdAt?: string or Date; updatedAt?: string | Date; invalid?: boolean; unlimited?: boolean; total?: number; remaining?: number; uses?: number; }; }>

:gear: createInvite

MethodType
createInvite(args?: { id?: string; email?: string; expires?: number; data?: any; unlimited?: boolean; total?: number; }) => Promise<{ invite: { id?: string; email?: string; code?: string; expires?: number; data?: any; createdAt?: string or Date; ... 5 more ...; uses?: number; }; }>

:gear: invalidateInvite

MethodType
invalidateInvite(args: { id?: string; }) => Promise<{ invite: { id?: string; email?: string; code?: string; expires?: number; data?: any; createdAt?: string or Date; updatedAt?: string | Date; invalid?: boolean; unlimited?: boolean; total?: number; remaining?: number; uses?: number; }; }>

:gear: filterInvites

MethodType
filterInvites(args?: { limit?: number; offset?: number; all?: boolean; }) => Promise<{ invites: { count: number; results: { id?: string; email?: string; code?: string; expires?: number; data?: any; createdAt?: string or Date; ... 5 more ...; uses?: number; }[]; }; }>

:gear: filterInviteLogs

MethodType
filterInviteLogs(args?: { limit?: number; offset?: number; all?: boolean; }) => Promise<{ inviteLogs: { count: number; results: { id?: string; inviteId?: string; email?: string; data?: any; createdAt?: string or Date; updatedAt?: string | Date; }[]; }; }>

:gear: findInvite

MethodType
findInvite(args: { email?: string; code?: string; }) => Promise<{ invite: { id?: string; email?: string; code?: string; expires?: number; data?: any; createdAt?: string or Date; updatedAt?: string | Date; invalid?: boolean; unlimited?: boolean; total?: number; remaining?: number; uses?: number; }; }>

:gear: getInvite

MethodType
getInvite(args: { id?: string; }) => Promise<{ invite: { id?: string; email?: string; code?: string; expires?: number; data?: any; createdAt?: string or Date; updatedAt?: string | Date; invalid?: boolean; unlimited?: boolean; total?: number; remaining?: number; uses?: number; }; }>

:gear: deleteInvite

MethodType
deleteInvite(args: { id?: string; }) => Promise<boolean>

:gear: getInviteLog

MethodType
getInviteLog(args: { id?: string; }) => Promise<{ inviteLog: { id?: string; inviteId?: string; email?: string; data?: any; createdAt?: string or Date; updatedAt?: string | Date; }; }>

:gear: deleteInviteLog

MethodType
deleteInviteLog(args: { id?: string; }) => Promise<boolean>

:gear: isValidInviteById

MethodType
isValidInviteById(args: { id?: string; }) => Promise<boolean>

:gear: isValidInviteByCode

MethodType
isValidInviteByCode(args: { email?: string; code?: string; }) => Promise<boolean>

:gear: useInvite

MethodType
useInvite(args: { code?: string; email?: string; data?: any; }) => Promise<{ invite: { id?: string; email?: string; code?: string; expires?: number; data?: any; createdAt?: string or Date; updatedAt?: string | Date; ... 4 more ...; uses?: number; }; inviteLog?: { ...; }; }>
0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago

0.0.0

9 months ago