/** * Framework client entry: browser-side helpers an app's frontend imports as * `@runworkai/framework/client`, so app code never carries this plumbing * itself. * * Analytics: what people do in the app, reported to the workspace. * * Envelope follows the Segment Spec (the de-facto standard Google Analytics, * Mixpanel, PostHog and friends all map to), so nothing here needs to change * if the workspace later forwards events to a real analytics tool. * * The app does not interpret events. `/api/analytics` stamps the app's * identity and forwards to the workspace, which decides what each one means. * Today a `page` counts as one USE of the app, the multiplier behind a * standalone app's value in the workspace's reports. `track` events are kept * for a later analytics surface. * * A page load is reported here because the document is served before the * app's Worker runs, leaving no server-side trace otherwise. Once per * document, not per route change: the workspace counts an opened tool, and a * person navigating inside it is still one use. * * Fire-and-forget. Nothing here may ever affect the person using the app. */ /** Record a custom event. Use a flat Title Case name ("Report Exported") and put variables in properties. */ export declare function track(event: string, properties?: Record): void; /** Record a named screen or view inside the app. */ export declare function screen(name: string, properties?: Record): void; /** * Tell the workspace who this browser belongs to, in the APP's own terms. * A claim, recorded as data; the workspace never grants anything on it. */ export declare function identify(userId: string, traits?: Record): void; /** Attach this person to a company, account or team the app knows about. */ export declare function group(groupId: string, traits?: Record): void; /** Link a past anonymous identity to a known one. */ export declare function alias(userId: string, previousId?: string): void; /** Record that this app was opened. Called once automatically on load. */ export declare function page(): void;