Secret internal features

We are still working on polishing our api’s but if you wanna build something cool RIGHT NOW, you can use some internal api’s to communicate with the whop app.
These function may throw. Use within a try {} catch (e) {} block.
import { __internal_execSync, __internal_execAsync } from "@whop/react-native";

// Example usage:
__internal_execSync("routerPush", {
  path: ["some", "second", "page"],
  params: { query: "hello" },
});
// Pro tip: the `path` and `query` is passed as a prop to the `ExperienceView`
// component. This is how multi level routing works for courses currently.

// Full list of calls and types available here:

export interface PathParams {
  path: string[];
  params: Record<string, string>;
}

export interface ExecSyncApi {
  getAppApiOrigin(params: EmptyObject): { apiOrigin: string };
  cacheGet(params: { key?: string | null }): { data?: string | null };
  cacheSet(params: { key?: string | null; data?: string | null }): EmptyObject;
  routerPush(params: PathParams): EmptyObject;
  routerPop(params: EmptyObject): EmptyObject;
  routerGetCurrent(params: EmptyObject): PathParams;
  setNavigationBarData(params: {
    title?: string | null;
    description?: string | null;
  }): EmptyObject;
  routerPresentSheet(params: PathParams): EmptyObject;
  routerDismissSheet(params: EmptyObject): EmptyObject;
  routerGetCurrentSheet(params: EmptyObject): PathParams | null | undefined;
  downgradeToWebView(params: EmptyObject): EmptyObject;
  getHostAppDetails(params: EmptyObject): {
    build: string;
    version: string;
    platform: "ios" | "android" | "web";
    buildType: "appstore" | "testflight" | "debug";
  };
}

export interface ExecAsyncApi extends ExecSyncApi {
  inAppPurchase(params: { id?: string | null; planId: string }): {
    sessionId: string;
    receiptId: string;
  };
}