import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const tokens = await client.users.tokens.list('user_id');
console.log(tokens.tokens);{
"tokens": [
{
"token": "<string>",
"provider_key": "firebase-fcm",
"expiry_date": "<string>",
"properties": "<unknown>",
"device": {
"app_id": "<string>",
"ad_id": "<string>",
"device_id": "<string>",
"platform": "<string>",
"manufacturer": "<string>",
"model": "<string>"
},
"tracking": {
"os_version": "<string>",
"ip": "<string>",
"lat": "<string>",
"long": "<string>"
}
}
]
}Gets all tokens available for a :user_id
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const tokens = await client.users.tokens.list('user_id');
console.log(tokens.tokens);{
"tokens": [
{
"token": "<string>",
"provider_key": "firebase-fcm",
"expiry_date": "<string>",
"properties": "<unknown>",
"device": {
"app_id": "<string>",
"ad_id": "<string>",
"device_id": "<string>",
"platform": "<string>",
"manufacturer": "<string>",
"model": "<string>"
},
"tracking": {
"os_version": "<string>",
"ip": "<string>",
"lat": "<string>",
"long": "<string>"
}
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The user's ID. This can be any uniquely identifiable string.
A list of tokens registered with the user.
Show child attributes