A React application showcasing Courier's core features using Courier React v8.2.0. Demonstrates Inbox, Template Designer, and Preferences with real Courier integration.
- React SPA - Built with React 19, Material-UI, and Courier React v8.2.0
- Production Ready - Uses real Courier APIs and authentication
- Vercel Deployed - Static deployment with environment variables
- Courier Integration - Live Inbox, Template Designer, and API demonstrations
git clone [your-repo]
cd basic-demo
npm install
npm startCreate a .env file in the root directory:
REACT_APP_COURIER_USER_ID=your-courier-user-id
REACT_APP_DEMO_JWT=your-jwt-token
REACT_APP_DEMO_TENANT_ID=your-tenant-idYou need a valid JWT token to authenticate with Courier. Generate one using:
curl -X POST https://api.courier.com/auth/issue-token \
-H "Authorization: Bearer YOUR_COURIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scope": "user_id:YOUR_USER_ID inbox:read:messages inbox:write:events",
"expires_in": "30 days"
}'See ENV_SETUP.md for detailed instructions.
- ✅ Dashboard - Overview of all Courier features
- ✅ Inbox - Live Courier Inbox with real-time notifications
- ✅ Archived Notifications - Example of fetching archived messages (v8 API)
- ✅ Template Designer - Live Courier Create integration
- ✅ Preferences Viewer - Notification preference display
- ✅ Courier v8.2.0 - Latest Courier React SDK
- ✅ Mobile Responsive - Material-UI design system
/ (root)
├── src/
│ ├── pages/
│ │ ├── Dashboard/ # Main dashboard with feature cards
│ │ ├── Inbox/ # Courier Inbox component
│ │ ├── ArchivedNotifications/ # Archived messages example
│ │ ├── Designer/ # Courier Create integration
│ │ └── Preferences/ # Notification preferences
│ ├── components/Layout/ # Navigation sidebar
│ ├── App.tsx # Main app with routing
│ └── index.tsx # Entry point
├── public/ # Static assets
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── vercel.json # Vercel deployment config
├── ENV_SETUP.md # Environment setup guide
└── README.md # This file
| Variable | Description | Example |
|---|---|---|
REACT_APP_COURIER_USER_ID |
Courier user ID | demo_user |
REACT_APP_DEMO_JWT |
JWT token for authentication | eyJhbGciOiJIUzI1Ni... |
REACT_APP_DEMO_TENANT_ID |
Courier tenant ID (optional) | tn_xxxxx... |
- JWT
user_idscope must matchREACT_APP_COURIER_USER_ID - JWT must have
inbox:read:messagesandinbox:write:eventsscopes - Generate JWT using the API (see ENV_SETUP.md)
- JWT expires based on
expires_inparameter when generating
- Real Courier Integration - Uses actual Courier APIs and authentication
- Latest SDK - Built with Courier React v8.2.0
- Fast Loading - Pure static assets on CDN
- Always Available - No server maintenance required
- Professional Look - Material-UI design system
- Archived Messages Example - Demonstrates Courier v8 API usage
JWT Token Refresh:
- Generate new JWT using the curl command in ENV_SETUP.md
- Update
REACT_APP_DEMO_JWTin environment variables - Vercel auto-redeploys on environment changes
Changing User:
- Update
REACT_APP_COURIER_USER_IDin environment variables - Regenerate JWT with matching
user_id:NEW_VALUEin scope - Update Vercel environment variables
- Connect Repository (GitHub/GitLab/Bitbucket)
- Framework Preset:
ViteorOther - Root Directory:
./(auto-detect) - Environment Variables: Add the 3 required variables
- Deploy
Vercel Configuration:
- Framework: React SPA
- Build Command:
npm run build - Output Directory:
build - Install Command:
npm install
Inbox doesn't load:
- Check
REACT_APP_DEMO_JWTis set correctly - Verify JWT hasn't expired
- Check browser console for authentication errors
JWT errors:
- Verify
REACT_APP_DEMO_JWTis exact token from API response - Check JWT hasn't expired
- Ensure JWT scope includes
inbox:read:messagesand other required permissions - Verify
REACT_APP_COURIER_USER_IDmatches the user_id in JWT scope
Designer doesn't load:
- Check
REACT_APP_DEMO_TENANT_IDis set - Verify tenant ID matches your Courier account
General:
- Check all environment variables are set
- Verify Courier account has necessary permissions
- Check browser console for detailed error messages
Built with Courier React v8.2.0 🚀 Production Ready ✨