Whop apps are embedded into the site using iFrames. This SDK provides a type-safe way for you to communicate with the Whop application using a request/response style API powered byDocumentation Index
Fetch the complete documentation index at: https://docs.whop.com/llms.txt
Use this file to discover all available pages before exploring further.
window.postMessage.
Since this package relies on window.postMessage, it only works in Client Components or client side javascript.
Relevant Packages
@whop/iframe- The main package for the iframe SDK.@whop/react- A React wrapper for Whop Apps including helpers for the iframe SDK.
Setup
The main function exported from the@whop/iframe package is the createSdk function. When called, this function sets up a listener for messages from the main Whop site, using window.on('message', ...). It is also exposed through the WhopIframeSdkProvider component from @whop/react.
React
If you’re using React, it is recommended to use theWhopIframeSdkProvider component from @whop/react to provide the iframe SDK to all child components.
Other Frameworks
For other frameworks, you can use thecreateSdk function from @whop/iframe to create an instance of the iframe SDK.
We have now setup the SDK and iFrame.
Opening External Links
Once the iframe SDK is initialized, you can use it to open external links. This will close your app and navigate to a new website.Opening User Profiles
If you want to display a Whop user profile, you can use theopenExternalUrl method and pass their profile page link which looks like https://whop.com/@username.
The Whop app will intercept this and display a modal containing their user profile instead of navigating away.
You can also use a user ID instead of username. The final link should look
like this:
https://whop.com/@user_XXXXXXXXIn-App Purchases
The iframe SDK provides a method to trigger in-app purchases directly within your app. This allows you to accept payments for one-time purchases or subscriptions using Whop’s checkout. To process in-app purchases, you’ll need to:- Create a checkout configuration on your server (with plan details and metadata)
- Use the iframe SDK’s
inAppPurchasemethod to open the payment modal - Handle the response and validate the payment via webhooks
For a complete guide on setting up in-app purchases including creating
checkout configurations, handling webhooks, and validating payments, see the
Accept payments documentation.

