Event types hooks
Overview of all the hooks associated with event types.
1. useEventTypes
The useEventTypes returns all event types associated with a user. Simply provide a username to fetch all their available event types. This hook is useful when you need to display or manage a user’s entire collection of event configurations.
Below code snippet shows how to use the useEventTypes hook to fetch the event types of a specific user.
2. useTeamEventTypes
The useTeamEventTypes returns all event types associated with a team. Simply provide the team id to fetch all their available event types. This hook is useful when you need to display or manage a team’s entire collection of event configurations.
Below code snippet shows how to use the useTeamEventTypes hook to fetch the event types of a team.
3. useEventTypeById
The useEventTypeById returns data for a specific event type, provided you pass in the correct event type id. This hook is useful when you need to display or manage a specific event type.
Below code snippet shows how to use the useEventTypeById hook to fetch a specific event type.
4. useCreateEventType
The useCreateEventType hook allows you to create a new event type. This hook returns a mutation function that handles the event type creation process. The mutation function accepts an object with the following properties: lengthInMinutes which is the length of the event in minutes, title which is the title of the event, slug which is the slug of the event, and description which is the description of the event.
Below code snippet shows how to use the useCreateEventType hook to setup an event type.
5. useCreateTeamEventType
The useCreateTeamEventType hook allows you to create a new team event type. This hook returns a mutation function that handles the event type creation process. The mutation function accepts an object with the following properties: lengthInMinutes which is the length of the event in minutes, title which is the title of the event, slug which is the slug of the event, description which is the description of the event, schedulingType which can be either COLLECTIVE, ROUND_ROBIN or MANAGED, hosts which is an array of hosts for the event and the teamId which is the id of the team.
Below code snippet shows how to use the useCreateTeamEventType hook to setup a team event type.
Was this page helpful?