Send push notifications to users in your app. Notifications appear in the Whop mobile app and web interface.
There are two ways to send notifications:
- Experience notifications - Send to users who have access to an experience (your app customers)
- Company notifications - Send to team members of a company (dashboard app users)
To send experience notifications, the experience must belong to your app. To
send company notifications, the company must have your app installed. No
additional permissions are required.
Sending to everyone in an experience
Send notifications to all users with access to an experience:
const result = await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'New Feature Available',
subtitle: 'Check it out now',
content: 'We just released a new feature that helps you track your progress better.',
});
console.log(result.success); // true
Example use case: If you’re building a fitness tracking app, you could
send a notification to everyone when a new workout program is released, or
send targeted notifications to users who completed a 7-day streak to celebrate
their achievement.
Sending to specific users
Use the user_ids parameter to send notifications only to specific users. These users must also have access to the experience.
const result = await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'Complete your daily workout',
content: 'You\'re 50% of the way to your goal. Finish strong!',
user_ids: ['user_abc123', 'user_def456'],
});
Sending to company team members
Send notifications to all team members of a company (dashboard app users):
const result = await client.notifications.create({
company_id: 'biz_xxxxxxxxxxxxxx',
title: 'Monthly Report Ready',
subtitle: 'October 2024',
content: 'Your monthly analytics report has been generated and is ready to view.',
});
Example use case: If you’re building a tax filing dashboard, you could
send notifications to all team members when a filing deadline is approaching,
or send targeted reminders to specific users who still need to complete steps
in the filing process.
Sending to specific team members
Use the user_ids parameter to send notifications only to specific team members. These users must also be team members of the company.
const result = await client.notifications.create({
company_id: 'biz_xxxxxxxxxxxxxx',
title: 'Action Required',
content: 'Please review and approve the pending invoices.',
user_ids: ['user_manager1', 'user_manager2'],
});
Deep linking with rest_path
Direct users to specific pages in your app when they tap a notification using the rest_path parameter.
Setting up your app path
First, configure your app path in the dashboard to handle the dynamic route parameter:
- Go to your app settings in the developer dashboard
- In the hosting section, update your “App path” to include
[restPath]
For experience apps:
/experiences/[experienceId]/[restPath]
For dashboard apps:
/companies/[companyId]/[restPath]
Sending notifications with deep links
Add the rest_path parameter to your notification. This will be appended to your app’s base URL.
// Experience app: Direct to a specific workout
await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'Today\'s Recommended Workout',
content: 'Based on your progress, we recommend this HIIT session.',
rest_path: '/workouts/hiit-advanced-1',
});
// Dashboard app: Direct to a specific report
await client.notifications.create({
company_id: 'biz_xxxxxxxxxxxxxx',
title: 'Unusual Activity Detected',
content: 'Review the flagged transactions in your dashboard.',
rest_path: '/reports/flagged-transactions',
});
Handling the route in your app
When a user taps the notification, they’ll be directed to the full URL constructed from your app path and the rest_path.
Example for experience app:
If your app is hosted at https://your-app.com and you send:
rest_path: "/posts/post_123";
The user will open:
https://your-app.com/experiences/exp_xxxxxxxxxxxxxx/posts/post_123
In Next.js, create a file at:
app/experiences/[experienceId]/posts/[postId]/page.tsx
In Express, handle the route:
app.get("/experiences/:experienceId/posts/:postId", (req, res) => {
// Handle the notification deep link
});
You can also use query parameters:
rest_path: "?action=review&id=123";
Custom notification icons
By default, notifications display your experience or company avatar. Customize the icon by providing a Whop user ID whose profile picture will be used.
await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'New Comment',
content: 'Sarah replied to your post: "Great progress!"',
icon_user_id: 'user_sarah123',
rest_path: '/posts/my-post-123',
});
This is useful for social features where you want to show who performed an action (commented, liked, followed, etc).