How to send push notifications with Next.js

Updated on April 05, 2026

Learn how to send Signalgrid push notifications
from Next.js route handlers and server-side code.

Signalgrid makes it straightforward to send notifications from Next.js. The platform uses a simple model built around your client_key, a target channel, and a few core fields such as title, body, type, and optional critical.

Next.js can send notifications from server-side handlers, internal admin tools, sign-up flows, and deployment-related routes without exposing your client key in the browser.

What you need

  • A Signalgrid account
  • Your client key
  • A channel token
  • Next.js available in your environment

Basic example

The following example sends a simple notification with Next.js.

export async function POST() {
  const payload = new URLSearchParams({
    client_key: process.env.SIGNALGRID_CLIENT_KEY,
    channel: process.env.SIGNALGRID_CHANNEL,
    title: "New Signup",
    body: "A new user created an account.",
    type: "INFO"
  });

  const response = await fetch("https://api.signalgrid.co/v1/push", {
    method: "POST",
    body: payload,
    cache: "no-store"
  });

  const result = await response.json();
  return Response.json(result);
}

Required fields

Field
Description
client_key
Authenticates the request on behalf of your Signalgrid user
channel
The channel token that should receive the notification
title
Short notification title
body
Main notification message
type
Visual notification type such as INFO, WARN, SUCCESS, or CRIT
critical
Optional flag for urgent notifications

Environment variables

Keeping credentials outside your code is usually the better move.

SIGNALGRID_CLIENT_KEY=your_client_key
SIGNALGRID_CHANNEL=your_channel_token

Example: Route Handlers and Server Actions

Next.js can send notifications from server-side handlers, internal admin tools, sign-up flows, and deployment-related routes without exposing your client key in the browser.