| title | `WaitlistFuture` |
|---|---|
| description | The current active `Waitlist` instance, for use in custom flows. |
| sdk | js-frontend |
The WaitlistFuture class provides methods and properties to manage waitlist entries in your application. It is used when you want to build a custom waitlist UI instead of using the prebuilt <Waitlist /> component.
The unique identifier for the waitlist entry. undefined if the user has not joined the waitlist yet.
createdAtDate | null
The date and time the waitlist entry was created. null if the user has not joined the waitlist yet.
updatedAtDate | null
The date and time the waitlist entry was last updated. null if the user has not joined the waitlist yet.
Submits an email address to join the waitlist. This method creates a new waitlist entry for the provided email address.
function join(params: JoinWaitlistParams): Promise<{ error: unknown }>The email address to add to the waitlist.
'use client'
import { useWaitlist } from '@clerk/react'
export default function WaitlistPage() {
const { waitlist } = useWaitlist()
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault()
const formData = new FormData(e.currentTarget)
const emailAddress = formData.get('emailAddress') as string
const { error } = await waitlist.join({ emailAddress })
if (error) {
console.error('Failed to join waitlist:', error)
}
}
return (
<form onSubmit={handleSubmit}>
<input type="email" name="emailAddress" required />
<button type="submit">Join Waitlist</button>
</form>
)
}