await client.createDevice({
id: "<push token>",
});
Push Notifications
The Stream API doesn’t support web push notifications. However, if you’re building a mobile application using JavaScript technologies, you can set up mobile push notifications using one of the supported providers: Firebase Cloud Messaging, Apple Push Notification (APN), Huawei Push and Xiaomi Push.
Configuring push providers
More information on how to configure push providers is coming soon.
Device management
Device management lets you register your push tokens to the Stream API, which is used to deliver push notifications.
Creating a device
Listing devices
If you want to list the devices that are registered to the current user, you should use the listDevices
method:
await client.listDevices({ user_id: "<user id>" });
The device contains the following properties:
created_at: Date;
id: string;
push_provider: string;
user_id: string;
disabled?: boolean;
disabled_reason?: string;
push_provider_name?: string;
voip?: boolean;
Removing devices
await client.deleteDevice({
id: "<device id>",
});