Skip to content

trycourier/next-js-inbox-toast-preferences

Repository files navigation

This repository is a Next.js project bootstrapped with create-next-app.

Its purpose is to display Courier's Inbox, Toast, and Preference page implementations using Courier's client-side React libraries @trycourier/react-provider, @trycourier/react-inbox, @trycourier/react-preferences, and @trycourier/react-toast. These packages use React Context and are instantiated with 'use client'; see the structure in components. This example also includes server-side rendering of Courier profile information as well as sending notifications with Courier's server-side Node library @trycourier/courier-node.

Getting Started

git clone git@github.com:bwebs/courier-next-js-examples.git
mv .env.local.example .env.local
# fill in NEXT_PUBLIC_COURIER_CLIENT_KEY and COURIER_AUTH_TOKEN from your Courier instance.
npm run dev

Open http://localhost:3000 with your browser to see the Inbox and Preferences examples.

Note

This repository is an example of using Courier's client key; consider using JWT's to secure Preferences, Toasts, and Inbox for each.