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.
import { whopSdk } from "@whop/react-native";
import { useQuery } from "@tanstack/react-query";

export function MyComponent() {
  const { data: user } = useQuery({
    queryKey: ["user"],
    queryFn: () => whopSdk.users.getCurrentUser(),
  });

  return <Text>{user?.name}</Text>;
}
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.
  1. Set your api origin as the Base Domain in the developer dashboard
  2. Make a normal fetch request from your react native app using the apiOrigin from __internal_execSync("getAppApiOrigin", {})
const apiOrigin = __internal_execSync("getAppApiOrigin", {});

// Assuming your server has this api endpoint:
fetch(`${apiOrigin}/api/v1/users/me`).then((res) => res.json());
  1. 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.