tinylib.reminders
Your app schedules reminders for its own user, outside any room, and Tinylib shows each one as a notification when it's due. Each reminder has a name, unique to the user in your app. Every call works offline, and Tinylib syncs the reminders to the user's other devices. Platforms says how reminders go off on each device.
Setting a reminder needs "reminders" in your app's uses.
Sets the reminder
name, replacing any reminder with that name, and resolves once this device has saved it. While your app's Reminders switch is off, the reminder is kept but doesn't go off.JavaScript
await tinylib.reminders.set('evening', { title: 'Journal', repeat: tinylib.reminders.daily('18:00') })
Parameters
- namestring
- The reminder's name, up to 64 characters.
- optionsReminderOptions
- What the reminder says, when it goes off, and where it opens.
Rejects with
- refused
- When
name,title,text, oraddressis too long, oratis a date that doesn't exist, such as'2026-02-30T10:00'. - When your app's
useslacks"reminders".
- When
- limit
- When the user already has 32 of your app's reminders. Setting a name already in use doesn't count again.
- ended
- When the user deleted their data in your app.
- TypeError
- When
nameortitleis empty,optionsdoesn't have exactly one ofatandrepeat,atis in the wrong form,addressstarts with/, or a field has the wrong type.
Caveats
- An
atthat has already passed sets nothing, cancels any reminder with that name, and still resolves. - A repeating reminder first goes off at the next time its schedule matches, and can't be set to start later.
JavaScript
tinylib.reminders.daily('18:00') // { every: 'day', time: '18:00' }
Parameters
- timestring
'HH:MM'on a 24-hour clock, in the device's time zone.
Returns
- Repeat
- The schedule, for
repeatintinylib.reminders.set.
Throws
- TypeError
- When
timeisn't'HH:MM'.
Makes a schedule for each of
days at time.JavaScript
tinylib.reminders.weekly(['mon', 'tue', 'wed', 'thu', 'fri'], '09:30')
Parameters
- daysDay[]
- The days of the week, each once, from
'mon'to'sun'. - timestring
'HH:MM'on a 24-hour clock, in the device's time zone.
Returns
- Repeat
- The schedule, for
repeatintinylib.reminders.set.
Throws
- TypeError
- When
daysis empty, lists a day twice, or holds something that isn't a day, or whentimeisn't'HH:MM'.
Makes a schedule for day
day of every month at time. In a month without that day, the reminder goes off on the month's last day.JavaScript
tinylib.reminders.monthly(31, '09:00') // the last day of every month
Parameters
- daynumber
- The day of the month, from 1 to 31.
- timestring
'HH:MM'on a 24-hour clock, in the device's time zone.
Returns
- Repeat
- The schedule, for
repeatintinylib.reminders.set.
Throws
- TypeError
- When
dayisn't an integer from 1 to 31, ortimeisn't'HH:MM'.
Lists the user's reminders in your app that will go off again. The user can cancel reminders from your app's page in Tinylib, so read the list each time you show it.
JavaScript
const evening = (await tinylib.reminders.list()).find((reminder) => reminder.name === 'evening')
tinylib.reminders.cancel(name: string): Promise<void>
Cancels the reminder
name. Resolves without doing anything when there's none.JavaScript
await tinylib.reminders.cancel('evening')
Parameters
- namestring
- The reminder's name.
interface Reminder
One of the user's reminders, as
tinylib.reminders.list() resolves with it.Properties
- namestring
- The name it was set under.
- titlestring
- The notification's title.
- textstring | null
- The notification's text, or null when it has none.
- addressstring
- The address your app opens at when the user taps the reminder.
''is the start screen. - atstring | number | null
- For a one-time reminder, the
atit was set with: a local date and time such as'2026-10-06T18:00', or milliseconds on Tinylib's clock. Null for a repeating reminder. - repeatRepeat | null
- For a repeating reminder, its schedule. Null for a one-time reminder.
- timeZonestring
- The IANA time zone the reminder was set in, such as
'Europe/London'. - nextnumber | null
- When the reminder next goes off, in milliseconds on Tinylib's clock, or null once it won't go off again.
interface ReminderOptions
What a reminder says, when it goes off, and where it opens. Give exactly one of
at and repeat.Properties
- titlestring
- The notification's title, up to 80 characters.
- textstringoptional
- The notification's text, up to 200 characters.
- atstring | numberoptional
- For a one-time reminder, when it goes off: a local date and time,
'YYYY-MM-DDTHH:MM'with optional:SS, in the device's time zone, or milliseconds on Tinylib's clock, such astinylib.now()plus a delay. - repeatRepeatoptional
- For a repeating reminder, its schedule, made with
daily,weekly, ormonthly. - addressstringoptional
- The address your app opens at when the user taps the reminder, without a leading
/, up to 100 characters. Defaults to'', the start screen.
type Repeat =
| { every: 'day'; time: string }
| { every: 'week'; days: Day[]; time: string }
| { every: 'month'; day: number; time: string }
A repeating reminder's schedule, made with
tinylib.reminders.daily, weekly, or monthly. time is 'HH:MM' in the time zone where the reminder was set, wherever the user goes.type Day = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'
A day of the week, for
tinylib.reminders.weekly.