Basic Invite Handling API and Package
- Go to invited.vercel.app and create an account
- Create a new project, and get the
apiToken
You have two choices, you can use the api directly or use the client package
yarn add invited axios
const invited = new Invited('apiTokenHere')
await invited.verify('example@example.com')
const invite = await invited.create()
// https://invited.vercel.app/[slug]
// Can modify this URL in the constructor
const invited = new Invited('apiTokenHere', {baseUrl : "YOUR WEBSITE"})
await invited.consume('example@example.com','slug')
You can set any of the following options in the constructor
export type Options = {
modal?: boolean
baseUrl?: string
darkMode?: boolean
homeUrl?: string
redirectUrl?: string
}
Option | Default | Description |
---|---|---|
modal | true |
If a modal should show if the user is not invited |
darkMode | true |
If the modal should be dark mode or not |
baseUrl | invited.vercel.app |
The base url to which the slug is added |
homeUrl | / |
THe url to return too on the modal |
redirectUrl | undefined |
The url to redirect too after consume an invite |