Stream Chat
Profile Requirements
To deliver a message to a recipient over Stream Chat, Courier must be provided a channelType and channelId OR a messageId
This value should be included in the recipient profile as streamChat
.
{
"message": {
//RecipientProfile using channelType and channelId
"to": {
"streamChat": {
"channelType": "messaging",
"channelId": "my-channel-id"
}
}
}
}
{
"message": {
//RecipientProfile using messageId (required for updating an existing message)
"to": {
"streamChat": {
"messageId": "my-message-id"
}
}
}
}
Override
Overrides can be used to change the request body that Courier uses to send the message. Overrides are useful when a field is not yet supported by Courier or you would like to override the value that Courier generates.
- You can override any of the fields supported by Stream Chat's
POST
/channels/{type}/{id}/message
API endpoint. See all send request body fields here. - You can also override the
apiKey
,apiSecret
andsenderId
fields via the override config object - You can also override
baseUrl
(defaulted to "https://chat-us-east-1.stream-io-api.com")
{
"message": {
"template": "<COURIER_NOTIFICATION_ID>",
"to": {
"streamChat": {
"channelType": "messaging",
"channelId": "my-channel-id"
}
},
"data": {
"name": "Foo Bar"
},
"providers": {
"stream-chat": {
"override": {
"body": {
"skip_push": true
},
"config": {
"baseUrl": "<overriden-base-url>",
"apiKey": "<overriden-api-key>",
"apiSecret": "<overriden-api-secret>",
"senderId": "<overriden-sender-id>"
}
}
}
}
}
}