Skip to main content
The JavaScript SDK can register browser device details and fetch in-app notifications for rendering inside your page.

Register a device

registerDevice records a device against the current contact. The os field identifies the device platform. A browser can register without a push token.
Required fields: token is optional. Registering a browser device without a token does not enable push delivery. You must have called identify, or pass anonymousId / externalId explicitly, before registerDevice succeeds.

Fetch in-app notifications

Notifications targeted at the user via campaigns or journeys land in a queue you read with getNotifications. The SDK does not render them; you decide when and how.
The three content types share title, body, and an optional custom map. The alert and html types also carry an html field with the rendered markup; alert adds an optional image URL.

Mark a notification read

Call markNotificationRead once the user dismisses or acknowledges the notification. The platform stops returning it from getNotifications after that.
For the BrowserClient, the cached externalId and anonymousId are passed automatically. For the bare Client, pass them as the second argument:

Worked example: fetch on app load, mark read on dismiss

Next steps

Set up push providers

Configure APN and FCM credentials before mobile or web push can deliver.

Typed API client

Server-side surface for higher-volume notification listing.