Prerequisites
- A NowPush account
- Your NowPush API key
Setup
Open the in Courier, enter your API key, then click “Save.”Profile requirements
Device tokens live on the user profile rather than on the send, so one profile can hold tokens for several devices and every push provider reads them from the same place. covers the model. NowPush needs no profile data. If your notification template includesdevice_type, message_type, url or apiKey, those values replace the configuration.
{
"message": {
"to": {
"nowpush": {
"device_type": "browser",
"message_type": "link",
"url": "www.nowpush.com",
"apiKey": ""
}
}
}
}
Overrides
covers the two levels and which one wins. lists the fields every push provider takes. A provider override changes the request body Courier sends to NowPush, or swaps the API key and URL.Body overrides
This example sets the device type and the message type:const { requestId } = await courier.send.message({
message: {
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
to: {},
providers: {
nowpush: {
override: {
body: {
device_type: "browser",
message_type: "nowpush_msg",
},
},
},
},
},
});
response = client.send.message(
message={
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
"to": {},
"providers": {
"nowpush": {
"override": {
"body": {
"device_type": "browser",
"message_type": "nowpush_msg",
},
},
},
},
},
)
curl -X POST https://api.courier.com/send \
-H "Authorization: Bearer $COURIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
"to": {},
"providers": {
"nowpush": {
"override": {
"body": {
"device_type": "browser",
"message_type": "nowpush_msg"
}
}
}
}
}
}'
response = courier.send_.message(
message: {
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
to: {},
providers: {
nowpush: {
override: {
body: {
device_type: "browser",
message_type: "nowpush_msg"
}
}
}
}
}
)
response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
Message: courier.SendMessageParamsMessage{
To: courier.SendMessageParamsMessageToUnion{
OfUserRecipient: &shared.UserRecipientParam{
},
},
Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
Providers: shared.MessageProvidersParam{
"nowpush": shared.MessageProvidersTypeParam{
Override: map[string]any{
"body": map[string]any{
"device_type": "browser",
"message_type": "nowpush_msg",
},
},
},
},
},
})
SendMessageParams params = SendMessageParams.builder()
.message(SendMessageParams.Message.builder()
.to(UserRecipient.builder().build())
.template("nt_01kx4h2jdafq8bk9aftxak4b40")
.providers(MessageProviders.builder()
.putAdditionalProperty("nowpush", JsonValue.from(java.util.Map.of("override", java.util.Map.of(
"body", java.util.Map.of(
"device_type", "browser",
"message_type", "nowpush_msg"
)
))))
.build())
.build())
.build();
SendMessageResponse response = client.send().message(params);
$response = $client->send->message(
message: [
'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
'to' => [],
'providers' => [
'nowpush' => [
'override' => [
'body' => [
'device_type' => 'browser',
'message_type' => 'nowpush_msg',
],
],
],
],
],
);
SendMessageParams parameters = new()
{
Message = new()
{
To = new UserRecipient { },
Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
Providers = new Dictionary<string, MessageProvidersType>()
{
{
"nowpush",
new()
{
Override = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
"""
{
"body": {
"device_type": "browser",
"message_type": "nowpush_msg"
}
}
"""
),
}
},
},
},
};
var response = await client.Send.Message(parameters);
courier send message \
--api-key "$COURIER_API_KEY" \
--message.to '{}' \
--message.template nt_01kx4h2jdafq8bk9aftxak4b40 \
--message.providers '{"nowpush": {"override": {"body": {"device_type": "browser", "message_type": "nowpush_msg"}}}}'
With Courier MCP, send my template through NowPush with the body overridden.
Config overrides
Swap the API key or URL at send time with a config override:const { requestId } = await courier.send.message({
message: {
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
to: {},
providers: {
nowpush: {
override: {
config: {
apiKey: "RUNTIME_API_KEY",
},
},
},
},
},
});
response = client.send.message(
message={
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
"to": {},
"providers": {
"nowpush": {
"override": {
"config": {
"apiKey": "RUNTIME_API_KEY",
},
},
},
},
},
)
curl -X POST https://api.courier.com/send \
-H "Authorization: Bearer $COURIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
"to": {},
"providers": {
"nowpush": {
"override": {
"config": {
"apiKey": "RUNTIME_API_KEY"
}
}
}
}
}
}'
response = courier.send_.message(
message: {
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
to: {},
providers: {
nowpush: {
override: {
config: {
apiKey: "RUNTIME_API_KEY"
}
}
}
}
}
)
response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
Message: courier.SendMessageParamsMessage{
To: courier.SendMessageParamsMessageToUnion{
OfUserRecipient: &shared.UserRecipientParam{
},
},
Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
Providers: shared.MessageProvidersParam{
"nowpush": shared.MessageProvidersTypeParam{
Override: map[string]any{
"config": map[string]any{
"apiKey": "RUNTIME_API_KEY",
},
},
},
},
},
})
SendMessageParams params = SendMessageParams.builder()
.message(SendMessageParams.Message.builder()
.to(UserRecipient.builder().build())
.template("nt_01kx4h2jdafq8bk9aftxak4b40")
.providers(MessageProviders.builder()
.putAdditionalProperty("nowpush", JsonValue.from(java.util.Map.of("override", java.util.Map.of(
"config", java.util.Map.of(
"apiKey", "RUNTIME_API_KEY"
)
))))
.build())
.build())
.build();
SendMessageResponse response = client.send().message(params);
$response = $client->send->message(
message: [
'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
'to' => [],
'providers' => [
'nowpush' => [
'override' => [
'config' => [
'apiKey' => 'RUNTIME_API_KEY',
],
],
],
],
],
);
SendMessageParams parameters = new()
{
Message = new()
{
To = new UserRecipient { },
Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
Providers = new Dictionary<string, MessageProvidersType>()
{
{
"nowpush",
new()
{
Override = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
"""
{
"config": {
"apiKey": "RUNTIME_API_KEY"
}
}
"""
),
}
},
},
},
};
var response = await client.Send.Message(parameters);
courier send message \
--api-key "$COURIER_API_KEY" \
--message.to '{}' \
--message.template nt_01kx4h2jdafq8bk9aftxak4b40 \
--message.providers '{"nowpush": {"override": {"config": {"apiKey": "RUNTIME_API_KEY"}}}}'
With Courier MCP, send my template through NowPush with a different API key.
Provider details
nowpush
routing.channels instead is supported, and sends through just this provider.
Send to a specific provider
When that is worth doing, and what you give up: failover, channel priority, and providers you add later.