Skip to main content
Try it live:

Preferences demo

See the preferences center in action.
Courier Preferences is an embeddable UI where a signed-in user picks the topics they receive and how each is delivered. It uses the same SDKs and signIn as the inbox. If you already have the inbox, preferences is one more component.
The Courier preferences center with its default styling: a topic section with per-topic toggles and an expanded channel picker for email, push, and SMS

The Courier preferences center with its default styling.

The component renders empty unless the user’s JWT has read:preferences write:preferences in its scope string, as covers.

Set up

Install the SDK for your framework:
On mobile, the SDK also needs native project setup before it renders: , , , and . Then and render the preferences component:
Full SDK references: , , , , , , , .

Choose a display mode

The mobile components take a mode that sets how much control the user gets:
  • Topic mode: one on/off toggle per subscription topic. The simplest option, and the usual choice.
  • Channels mode: per-channel controls within each topic, so a user can keep a topic but receive it by email only.
The web components do not take a display mode. They always render topics with their channel controls. Their mode prop is the theme mode: "light", "dark", or "system". See .
You configure topics and sections in the . For how Courier enforces these choices at send time, see .

Props

<CourierPreferences /> in React, Vue, and Angular. The web component takes the same values as kebab-case attributes, and courier-preferences is the element name. The web component also exposes setLightTheme, setDarkTheme, setMode, setChannelLabels, setPreviewData, and setLoading on the element, for hosts that hold a ref rather than re-rendering with new props.

Verify

1

Sign in with preference scopes

Sign in a user whose JWT includes read:preferences write:preferences.
2

Open the preferences screen

Open the screen that renders the preferences component.
3

Confirm topics persist

Your workspace’s preference topics appear, and toggling one persists after a reload.