await client.createDevice({
id: "<push token>",
user_id: "<user id>",
});
Push Notifications
We suggest setting up push notifications using one of Stream’s client-side SDKs. However, if your use-case doesn’t allow for this, you can call Stream’s device management endpoints from your server-side integration as well. Stream API supports the following push 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();
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>",
user_id: "<user id>",
});