Skip to main content
Schedules define when notifications should be delivered by setting availability hours across days of the week. The useSchedule hook provides a way to fetch, display, and update the notification schedule for the current subscriber.

Hook parameters

Return value

Schedule type

The Schedule type from @novu/react includes these properties:

Schedule object structure.

Each DaySchedule object within weeklySchedule has the following structure:

Updating the schedule

The hook also allows updating the subscriber’s schedule via schedule.update:

Example usage

Here’s how to use the useSchedule hook to display and update a subscriber’s notification schedule. The schedule.update() method creates a schedule if one doesn’t exist or updates the existing one.