export type PostHogReactNativePluginMap = { [key: string]: any; }; export interface PostHogReactNativePluginSessionReplayConfig { enabled?: boolean; sdkReplayConfig?: PostHogReactNativePluginMap; decideReplayConfig?: PostHogReactNativePluginMap; } export interface PostHogReactNativePluginExceptionStepsConfig { enabled?: boolean; maxBytes?: number; } export interface PostHogReactNativePluginErrorTrackingConfig { nativeAutocapture?: boolean; exceptionSteps?: PostHogReactNativePluginExceptionStepsConfig; } export interface PostHogReactNativePluginPushConfig { capturePushNotificationSubscriptions?: boolean; capturePushNotificationOpened?: boolean; /** * A provider callback can't cross the bridge, so this only tells native whether to * install the bridging provider at all — installing one the host didn't ask for * would change how the native SDK handles a 401 on the subscription call. * Pair with {@link setPushIdentityProvider} before calling setup(). */ pushIdentityProviderEnabled?: boolean; } export interface PostHogReactNativePluginConfig { sessionReplay?: PostHogReactNativePluginSessionReplayConfig; errorTracking?: PostHogReactNativePluginErrorTrackingConfig; push?: PostHogReactNativePluginPushConfig; } export declare function setup(sessionId: string, sdkOptions: PostHogReactNativePluginMap, pluginConfig?: PostHogReactNativePluginConfig): Promise; export declare function start(sessionId: string, sdkOptions: PostHogReactNativePluginMap, sdkReplayConfig: PostHogReactNativePluginMap, decideReplayConfig: PostHogReactNativePluginMap): Promise; export declare function startSession(sessionId: string): Promise; export declare function endSession(): Promise; export declare function isEnabled(): Promise; export declare function identify(distinctId: string, anonymousId: string): Promise; /** * Resets the native SDK's identity on logout. Unlike {@link identify}, this calls the native * SDK's own `reset()`, which unregisters the logged-out user's push subscription and * re-registers it under the new anonymous id. */ export declare function reset(distinctId: string, anonymousId: string): Promise; export declare function startRecording(resumeCurrent: boolean): Promise; export declare function stopRecording(): Promise; export declare function addExceptionStep(message: string, properties?: PostHogReactNativePluginMap): Promise; export declare function registerPushNotificationToken(deviceToken: string, appId: string | null): Promise; export declare function unregisterPushNotificationToken(): Promise; /** * Propagates a runtime consent change to the native SDK, which otherwise only reads the JS * opt-out flag at setup() and could auto-register a refreshed push token after optOut(). */ export declare function setOptOut(optOut: boolean): Promise; export declare function capturePushNotificationOpened(properties: PostHogReactNativePluginMap): Promise; /** * Mints a signed identity-verification token for a push subscription request. * Return null to send the request without an identity token. */ export type PostHogPushIdentityProvider = (distinctId: string, appId: string) => Promise; /** * Installs the JS side of the push identity-provider bridge. The native SDK asks for a * token via a `PostHogPushIdentityRequest` event; the reply is routed back with * `providePushIdentityToken`, keyed by the request id so late replies are ignored. * * Install before setup() with `push.pushIdentityProviderEnabled` set, so the native * config gets its bridging provider at SDK initialization. Any provider failure * degrades to a null token — an unauthenticated request — never a stalled mint. */ export declare function setPushIdentityProvider(provider: PostHogPushIdentityProvider): void; export interface PostHogReactNativePluginModule { setup: (sessionId: string, sdkOptions: PostHogReactNativePluginMap, pluginConfig?: PostHogReactNativePluginConfig) => Promise; /** * Legacy session replay setup entrypoint. Prefer setup() for new native features. */ start: (sessionId: string, sdkOptions: PostHogReactNativePluginMap, sdkReplayConfig: PostHogReactNativePluginMap, decideReplayConfig: PostHogReactNativePluginMap) => Promise; startSession: (sessionId: string) => Promise; endSession: () => Promise; isEnabled: () => Promise; identify: (distinctId: string, anonymousId: string) => Promise; reset: (distinctId: string, anonymousId: string) => Promise; startRecording: (resumeCurrent: boolean) => Promise; stopRecording: () => Promise; addExceptionStep: (message: string, properties?: PostHogReactNativePluginMap) => Promise; registerPushNotificationToken: (deviceToken: string, appId: string | null) => Promise; unregisterPushNotificationToken: () => Promise; setOptOut: (optOut: boolean) => Promise; capturePushNotificationOpened: (properties: PostHogReactNativePluginMap) => Promise; setPushIdentityProvider: (provider: PostHogPushIdentityProvider) => void; } declare const PostHogReactNativePlugin: PostHogReactNativePluginModule; export default PostHogReactNativePlugin; //# sourceMappingURL=index.d.ts.map