Whop SDK
The whop sdk is available for use in the react native app out of the box. Using this you can fetch data within the scope of the current user.We recommend using the useQuery hook from @tanstack/react-query to fetch
data.
Some operations are only available on the server, so make sure you call those from your api. Check out the SDK reference to see which ones have the “server only” flag.
Making authenticated requests
You can make authenticated requests to your api by using the same proxy infrastructure used for existing web apps.- Set your api origin as the
Base Domain
in the developer dashboard - Make a normal fetch request from your react native app using the
apiOrigin
from__internal_execSync("getAppApiOrigin", {})
- On your server use the standard
verifyUserToken
function from the SDK to verify the request. Auth between react native apps and whop iframe apps is exactly the same meaning you can reuse your backend.