@whop/react
Version:
React SDK for building embedded apps on Whop
26 lines (25 loc) • 931 B
TypeScript
import { type proto } from "@whop/api";
import React, { type PropsWithChildren } from "react";
/**
* Props for the `WhopWebsocketProvider` component.
*/
export interface WhopWebsocketProviderProps {
/**
* **Optional** - The custom channels to join when connecting to the websocket.
*/
joinCustom?: string | string[];
/**
* **Optional** - The experience channels to join when connecting to the websocket.
*
* @example exp_XXXX
*/
joinExperience?: string | string[];
/**
* A callback that is called when an app message is received.
*/
onAppMessage?: ((message: proto.common.AppMessage) => void) | null;
}
/**
* A provider that allows you to connect to the websocket and receive app messages.
*/
export declare function WhopWebsocketProvider({ children, joinCustom, joinExperience, onAppMessage, }: PropsWithChildren<WhopWebsocketProviderProps>): React.JSX.Element;