Skip to content

Notifications and the device

matter.notify shows an OS notification under the app’s name. Clicking it opens the app at path.

await matter.notify({
title: 'LinkedIn needs you',
body: 'Sign in again in Chrome, then press Resume on Today.',
path: '/today',
})
  • title is required, up to 120 characters. body can be up to 400.
  • path is a route of your app, starting with /. The default is /.
  • Matter shows the same words at most once in 10 minutes, and at most 10 notifications an hour for each app.

Notify the member when something needs them: an account to sign in to again, a decision only they can make. A worker or routine run that hits a problem it can’t solve should notify once, then wait.

matter.device() tells you about the computer the app is running on, and what agents may use there:

const { id, browserUseEnabled, computerUseEnabled } = await matter.device()

Use it on a setup page to check that the member’s routines can run here. A routine that needs the browser drives the member’s Chrome when Browser Use is on. A routine that needs computer fails on a computer where Computer Use is off. Members turn both on in Matter’s settings.