Example Demo Next.js typescript application implemented with firebase cloud messaging to send web push notifications.
First create an .env
file in the root directory. It should include following variables.
NEXT_PUBLIC_VAPID_KEY
NEXT_PUBLIC_FIREBASE_API_KEY
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
NEXT_PUBLIC_FIREBASE_PROJECT_ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET
NEXT_PUBLIC_FIREBASE_MESSAGING_ID
NEXT_PUBLIC_FIREBASE_APP_ID
NEXT_PUBLIC_FIREBASE_SERVER_KEY
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.