Send a notification to everyone in an experience.
Make sure you have setup your whop SDK client on the
server
Adding a deeplink to the notification.
When you send a notification, you will usually want to send the user to specific section in your app upon clicking the notification. You can do this by using therestPath property.
-
Update your app path in the dashboard to handle the additional parameters.
In the hosting section, set the “App path” field to something like:
/experiences/[experienceId]/[restPath] -
In your
sendPushNotificationcall, add therestPathproperty. -
Update you app to handle the following route:
When clicking on a notification, the user will open this specific url on your app within the whop iframe.
If using NextJS, you can add a
page.tsxfile with the path:app/experiences/[experienceId]/posts/[postId]/page.tsxNote: the exact path will depend on the pathname structure you set in therestPathproperty.
Sending a notification to company admins
Your app may want to alert company admins only, not all members. Use thecompanyTeamId field instead of the experienceId when sending the notification.
You must send either the
companyTeamId or the experienceId when sending a
notification. Setting both will result in an error.Sending a notification to a specific subset of users.
Use theuserIds field to filter the users who will receive the notification.
Whop will first apply either the experienceId or the companyTeamId filter and then apply the userIds filter
Ensure that the userIds array contains valid user IDs that are part of the specified experience or company team.
For example if you a building a bidding app you may want to alert the highest bidder if they were just outbid.

