@jeffjassky/telemetry 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/vue.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import type { TelemetryClient } from './core.js';
2
+
3
+ export { createClient } from './core.js';
4
+ export type { TelemetryClient } from './core.js';
5
+
6
+ export declare const TELEMETRY_KEY: 'telemetry';
7
+
8
+ /** Vue 3 plugin: installs the global errorHandler and provides the client. */
9
+ export declare function createTelemetryPlugin(client: TelemetryClient): {
10
+ install(app: {
11
+ config: { errorHandler?: (err: unknown, instance: unknown, info: string) => void };
12
+ provide(key: string, value: unknown): void;
13
+ }): void;
14
+ };
15
+
16
+ /** composition-API accessor — pass Vue's inject: useTelemetry(inject) */
17
+ export declare function useTelemetry(inject: (key: string) => unknown): TelemetryClient;
package/types/web.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import type { CreateClientOptions, Registry, TelemetryClient } from './core.js';
2
+
3
+ export { createClient } from './core.js';
4
+ export type { TelemetryClient } from './core.js';
5
+
6
+ export interface WebTelemetryOptions extends Omit<CreateClientOptions, 'storage' | 'consent'> {
7
+ /** host consent (cookie banner etc). ANDed with DNT/GPC — those always win. */
8
+ consent?: () => boolean;
9
+ /** auto-capture window.onerror / unhandledrejection (default true) */
10
+ captureGlobalErrors?: boolean;
11
+ }
12
+
13
+ /**
14
+ * Browser client: ClientContext capture, global error hooks, DNT/GPC gate,
15
+ * unload flush via sendBeacon (pk_ key rides the query string there).
16
+ */
17
+ export declare function createWebTelemetry<R extends Registry = Registry>(
18
+ opts: WebTelemetryOptions,
19
+ ): TelemetryClient<R>;