import * as posthog_js from 'posthog-js';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { ReactNode } from 'react';

type TelemetryUser = {
    /** Stable user id — typically the windsock JWT `sub`. */
    id: string;
    email?: string;
    name?: string;
    role?: string;
    /** Tenant id — from `https://datatechsolutions.com.br/organization_id` claim. */
    organizationId?: string;
};
type TelemetryProviderProps = {
    /** App slug — e.g. `astrlabe`, `sextant`, `data-br`. Tags every event. */
    app: string;
    /**
     * PostHog project token (write-only key, safe in browser bundles).
     * If unset, the provider falls back to `window.__APP_CONFIG__.posthog.key`
     * (set by the CDK-managed `runtime-config.js`) and then to
     * `import.meta.env.VITE_POSTHOG_KEY`. Pass explicitly only for tests
     * or sub-app embeds.
     */
    projectKey?: string;
    /**
     * PostHog ingestion host. Falls back through the same chain as
     * `projectKey`; defaults to US Cloud if nothing else resolves.
     */
    apiHost?: string;
    /** Whether to record session replays. Defaults to true. */
    recordSessions?: boolean;
    /** Current authenticated user, if any. The provider re-identifies on change. */
    user?: TelemetryUser | null;
    children: ReactNode;
};
/**
 * Wrap every SPA in this provider. Pass the windsock-resolved user so
 * PostHog associates events with the right tenant; pass `null` after
 * sign-out so the next session is anonymous.
 */
declare function TelemetryProvider({ app, projectKey: propProjectKey, apiHost: propApiHost, recordSessions, user, children, }: TelemetryProviderProps): react_jsx_runtime.JSX.Element;
/**
 * Re-export the posthog-js/react hook so consumer SPAs can capture
 * custom events without importing posthog-js directly:
 *
 *     const ph = useTelemetry()
 *     ph?.capture('workflow_run_started', { workflowId })
 */
declare const useTelemetry: () => posthog_js.PostHog;

export { TelemetryProvider, type TelemetryProviderProps, type TelemetryUser, useTelemetry };
