
<courier-inbox>— full-featured inbox for displaying and managing messages<courier-inbox-popup-menu>— popup menu version of the inbox<courier-toast>— toast notifications for time-sensitive alerts<courier-preferences>— notification preferences center for managing topic subscriptions and delivery
Installation
Inbox, Toast, and Preferences are published as separate packages. Install only the ones you need.Using React? Check out the Courier React SDK, which provides React components and hooks built on top of these Web Components.
Authentication
To use the SDK, you need to generate a JWT (JSON Web Token) for your user. This JWT should always be generated by your backend server, never in client-side code.JWT Authentication Flow
1
Your client calls your backend
When your app needs to authenticate a user, your client
should make a request to your own backend (ex.
GET https://your-awesome-app.com/api/generate-courier-jwt).2
Your backend calls Courier
In your backend endpoint, use your Courier API Key to call the Courier Issue Token Endpoint and generate a JWT for the user.
3
Your backend returns the JWT to your client
Having received the JWT from Courier, your backend should return it to your client and pass it to the Courier SDK.
Development Authentication with cURL
To quickly test JWT generation for development only, you can use cURL to call the Courier Issue Token Endpoint directly.Do not call the Issue Token API from client-side code. Always keep your Courier API keys secure.
Inbox Web Components
<courier-inbox>

Default Courier Inbox component
If you’re using tenants, you can scope requests to a particular
tenant by passing its ID to the For the full reference of sign in parameters, see the Courier JS docs.
signIn request.<courier-inbox-popup-menu>

Default Courier Inbox Popup Menu component
Tabs and Feeds
Tabs and feeds allow you to organize and filter messages in your inbox. A feed is a container that groups related tabs together. Each tab represents a filtered view of messages.If there is only one feed, the feed selection dropdown is hidden. If a feed has only one tab, the tab bar is hidden and the unread count appears next to the feed.

CourierInbox with many tabs
Handle Clicks and Presses
Use theonMessageClick(), onMessageActionClick(), and onMessageLongPress() methods to handle clicks and presses in the inbox.
Styles and Theming
The fastest way to style the Courier Inbox to match your app is with a custom theme.
Courier Inbox with a custom unread indicator style
Popup alignment, position, and dimensions

Customizing the popup menu's alignment, position, and dimensions
<courier-inbox> has a default height of auto. Set a fixed height with the height attribute:
Custom Elements
Customize individual parts of the inbox by passing factory functions that return HTML elements.Programmatic Control
The<courier-inbox> component exposes methods for programmatic control, allowing you to dynamically manage feeds, tabs, actions, and data refresh.
Feed and Tab Selection
Header Actions
Popup Menu Control (on <courier-inbox-popup-menu>)
Static Helper Methods
Attribute vs Method Usage
Many configuration options can be set either via HTML attributes or programmatic methods:- HTML attributes: Best for initial, static configuration
- Programmatic methods: Best for dynamic, runtime configuration
selectFeed(), refresh(), getFeeds()) and cannot be set via attributes.
Toast Web Components
Toasts are short-lived notifications that notify users and prompt them to take action. The Toast component is connected to the feed of Courier Inbox messages.<courier-toast>

Courier Toast component
HTML Attributes

Toast component with auto-dismiss enabled.
auto-dismiss attribute is set, the dismiss button (x) will only be visible on hover
and each toast item will automatically be dismissed. A countdown bar is shown to indicate the time
remaining before the toast disappears.
Handle Clicks

Courier Toast with action buttons
index.html
Styles and Theming

Courier toasts with a custom light theme
index.html
Toast items have a subtle default border:
1px solid #E5E5E5 in light mode and 1px solid #3A3A3A in dark mode. Override it with item.border.Custom Elements
Programmatic Control
Toast Datastore
CourierToastDatastore is the central repository of Inbox messages from which
<courier-toast> listens for messages to display and dismiss. It is a singleton accessed through CourierToastDatastore.shared.
Preferences Web Components
The Preferences component lets your users manage which topics they’re subscribed to and how each topic is delivered (per-channel routing and digest schedules), directly inside your app.<courier-preferences>
Preferences use the same authentication mechanism as the inbox, but the JWT must include the
read:preferences and write:preferences scopes.Preferences HTML Attributes
Preferences Styling and Theming
Set themes programmatically withsetLightTheme(), setDarkTheme(), and setMode(). Themes are merged with the defaults, so you only need to specify what you want to override. The default accent color matches the Inbox component for a consistent look.
index.html
defaultLightTheme / defaultDarkTheme for the defaults, and mergeTheme(mode, overrideTheme) to merge a partial theme.
Custom Channel Labels
Topics can be delivered over multiple channels. UsesetChannelLabels() to rename how those channels appear in the UI.
index.html
EU and regional endpoints
Only if your workspace uses the EU datacenter: pass EU URLs inCourier.shared.signIn. This package re-exports EU_COURIER_API_URLS and getCourierApiUrlsForRegion from @trycourier/courier-js.






