@databuddy/sdk 2.1.76 → 2.1.78

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/README.md CHANGED
@@ -1,130 +1,130 @@
1
- # Databuddy SDK & React Component
2
-
3
- [![npm version](https://img.shields.io/npm/v/@databuddy/sdk?style=flat-square)](https://www.npmjs.com/package/@databuddy/sdk)
4
- [![License](https://img.shields.io/npm/l/@databuddy/sdk?style=flat-square)](./LICENSE)
5
- [![Docs](https://img.shields.io/badge/docs-databuddy.cc-blue?style=flat-square)](https://www.databuddy.cc/docs)
6
-
7
- > **The easiest, privacy-first way to add analytics to your web app.**
8
-
9
- ---
10
-
11
- ## ✨ Features
12
-
13
- - 📊 **Automatic page/screen view tracking**
14
- - ⚡ **Performance, Web Vitals, and error tracking**
15
- - 🧑‍💻 **Custom event tracking**
16
- - 🧩 **Drop-in React/Next.js component: `<Databuddy />`**
17
- - 🛡️ **Privacy-first: anonymized by default, sampling, batching, and more**
18
- - 🛠️ **Type-safe config and autocompletion**
19
- - 📋 **Observability: logging, error tracking, and distributed tracing**
20
-
21
- ---
22
-
23
- ## 🚀 Quickstart
24
-
25
- ```sh
26
- bun add @databuddy/sdk
27
- # or
28
- npm install @databuddy/sdk
29
- ```
30
-
31
- Add to your root layout (Next.js/React):
32
-
33
- ```tsx
34
- import { Databuddy } from '@databuddy/sdk';
35
-
36
- export default function RootLayout({ children }) {
37
- return (
38
- <html lang="en">
39
- <head />
40
- <Databuddy
41
- clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
42
- trackScreenViews
43
- trackPerformance
44
- trackErrors
45
- enableBatching
46
- batchSize={20}
47
- />
48
- <body>{children}</body>
49
- </html>
50
- );
51
- }
52
- ```
53
-
54
- ---
55
-
56
- ## 🛠️ Configuration Options
57
-
58
- All options are type-safe and documented in `DatabuddyConfig`:
59
-
60
- | Option | Type | Default | Description |
61
- |-----------------------|-----------|--------------|-------------|
62
- | `clientId` | string | — | **Required.** Your Databuddy project client ID. |
63
- | `clientSecret` | string | — | (Advanced) For server-side use only. |
64
- | `apiUrl` | string | `https://api.databuddy.cc` | Custom API endpoint. |
65
- | `scriptUrl` | string | `https://cdn.databuddy.cc/databuddy.js` | Custom script URL. |
66
- | `sdk` | string | `web` | SDK name. Only override for custom builds. |
67
- | `sdkVersion` | string | *auto* | SDK version. Defaults to package version. |
68
- | `disabled` | boolean | `false` | Disable all tracking. |
69
- | `waitForProfile` | boolean | `false` | Wait for user profile before sending events. |
70
- | `trackScreenViews` | boolean | `true` | Auto-track page/screen views. |
71
- | `trackHashChanges` | boolean | `false` | Track hash changes in URL. |
72
- | `trackAttributes` | boolean | `false` | Track data-* attributes. |
73
- | `trackOutgoingLinks` | boolean | `false` | Track outgoing link clicks. |
74
- | `trackSessions` | boolean | `true` | Track user sessions. |
75
- | `trackPerformance` | boolean | `true` | Track page performance. |
76
- | `trackWebVitals` | boolean | `true` | Track Web Vitals. |
77
- | `trackEngagement` | boolean | `false` | Track engagement metrics. |
78
- | `trackScrollDepth` | boolean | `false` | Track scroll depth. |
79
- | `trackExitIntent` | boolean | `false` | Track exit intent. |
80
- | `trackInteractions` | boolean | `false` | Track user interactions. |
81
- | `trackErrors` | boolean | `true` | Track JS errors. |
82
- | `trackBounceRate` | boolean | `false` | Track bounce rate. |
83
- | `samplingRate` | number | `1.0` | Sampling rate (0.0–1.0). |
84
- | `enableRetries` | boolean | `true` | Retry failed requests. |
85
- | `maxRetries` | number | `3` | Max retries. |
86
- | `initialRetryDelay` | number | `500` | Initial retry delay (ms). |
87
- | `enableBatching` | boolean | `true` | Enable event batching. |
88
- | `batchSize` | number | `20` | Events per batch (1–50). |
89
- | `batchTimeout` | number | `5000` | Batch timeout (ms, 100–30000). |
90
-
91
- ---
92
-
93
- ## 💡 FAQ
94
-
95
- **Q: Is Databuddy privacy-friendly?**
96
- A: Yes! All analytics are anonymized by default. No cookies, no fingerprinting, no PII.
97
-
98
- **Q: Can I use this in Next.js, Remix, or plain React?**
99
- A: Yes! `<Databuddy />` works in any React app. For non-React, use the script tag directly.
100
-
101
- **Q: How do I disable analytics in development?**
102
- A: Use the `disabled` prop: `<Databuddy disabled={process.env.NODE_ENV === 'development'} ... />`
103
-
104
- **Q: Where do I find my `clientId`?**
105
- A: In your [Databuddy dashboard](https://app.databuddy.cc).
106
-
107
- ---
108
-
109
- ## 🧑‍💻 Troubleshooting
110
-
111
- - **Script not loading?**
112
- - Make sure your `clientId` is correct and the script URL is reachable.
113
- - **No events in dashboard?**
114
- - Check your config, especially `clientId` and network requests in the browser dev tools.
115
- - **Type errors?**
116
- - All config options are type-safe. Use your IDE's autocomplete for help.
117
- - **SSR/Next.js?**
118
- - The component is safe for SSR/React Server Components. It only injects the script on the client.
119
-
120
- ---
121
-
122
- ## 📚 Documentation & Support
123
-
124
- - [Databuddy Docs](https://www.databuddy.cc/docs)
125
- - [Dashboard](https://app.databuddy.cc)
126
- - [Contact Support](https://www.databuddy.cc/contact)
127
-
128
- ---
129
-
1
+ # Databuddy SDK & React Component
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@databuddy/sdk?style=flat-square)](https://www.npmjs.com/package/@databuddy/sdk)
4
+ [![License](https://img.shields.io/npm/l/@databuddy/sdk?style=flat-square)](./LICENSE)
5
+ [![Docs](https://img.shields.io/badge/docs-databuddy.cc-blue?style=flat-square)](https://www.databuddy.cc/docs)
6
+
7
+ > **The easiest, privacy-first way to add analytics to your web app.**
8
+
9
+ ---
10
+
11
+ ## ✨ Features
12
+
13
+ - 📊 **Automatic page/screen view tracking**
14
+ - ⚡ **Performance, Web Vitals, and error tracking**
15
+ - 🧑‍💻 **Custom event tracking**
16
+ - 🧩 **Drop-in React/Next.js component: `<Databuddy />`**
17
+ - 🛡️ **Privacy-first: anonymized by default, sampling, batching, and more**
18
+ - 🛠️ **Type-safe config and autocompletion**
19
+ - 📋 **Observability: logging, error tracking, and distributed tracing**
20
+
21
+ ---
22
+
23
+ ## 🚀 Quickstart
24
+
25
+ ```sh
26
+ bun add @databuddy/sdk
27
+ # or
28
+ npm install @databuddy/sdk
29
+ ```
30
+
31
+ Add to your root layout (Next.js/React):
32
+
33
+ ```tsx
34
+ import { Databuddy } from '@databuddy/sdk/react';
35
+
36
+ export default function RootLayout({ children }) {
37
+ return (
38
+ <html lang="en">
39
+ <head />
40
+ <Databuddy
41
+ clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
42
+ trackScreenViews
43
+ trackPerformance
44
+ trackErrors
45
+ enableBatching
46
+ batchSize={20}
47
+ />
48
+ <body>{children}</body>
49
+ </html>
50
+ );
51
+ }
52
+ ```
53
+
54
+ ---
55
+
56
+ ## 🛠️ Configuration Options
57
+
58
+ All options are type-safe and documented in `DatabuddyConfig`:
59
+
60
+ | Option | Type | Default | Description |
61
+ |-----------------------|-----------|--------------|-------------|
62
+ | `clientId` | string | — | **Required.** Your Databuddy project client ID. |
63
+ | `clientSecret` | string | — | (Advanced) For server-side use only. |
64
+ | `apiUrl` | string | `https://api.databuddy.cc` | Custom API endpoint. |
65
+ | `scriptUrl` | string | `https://cdn.databuddy.cc/databuddy.js` | Custom script URL. |
66
+ | `sdk` | string | `web` | SDK name. Only override for custom builds. |
67
+ | `sdkVersion` | string | *auto* | SDK version. Defaults to package version. |
68
+ | `disabled` | boolean | `false` | Disable all tracking. |
69
+ | `waitForProfile` | boolean | `false` | Wait for user profile before sending events. |
70
+ | `trackScreenViews` | boolean | `true` | Auto-track page/screen views. |
71
+ | `trackHashChanges` | boolean | `false` | Track hash changes in URL. |
72
+ | `trackAttributes` | boolean | `false` | Track data-* attributes. |
73
+ | `trackOutgoingLinks` | boolean | `false` | Track outgoing link clicks. |
74
+ | `trackSessions` | boolean | `true` | Track user sessions. |
75
+ | `trackPerformance` | boolean | `true` | Track page performance. |
76
+ | `trackWebVitals` | boolean | `true` | Track Web Vitals. |
77
+ | `trackEngagement` | boolean | `false` | Track engagement metrics. |
78
+ | `trackScrollDepth` | boolean | `false` | Track scroll depth. |
79
+ | `trackExitIntent` | boolean | `false` | Track exit intent. |
80
+ | `trackInteractions` | boolean | `false` | Track user interactions. |
81
+ | `trackErrors` | boolean | `true` | Track JS errors. |
82
+ | `trackBounceRate` | boolean | `false` | Track bounce rate. |
83
+ | `samplingRate` | number | `1.0` | Sampling rate (0.0–1.0). |
84
+ | `enableRetries` | boolean | `true` | Retry failed requests. |
85
+ | `maxRetries` | number | `3` | Max retries. |
86
+ | `initialRetryDelay` | number | `500` | Initial retry delay (ms). |
87
+ | `enableBatching` | boolean | `true` | Enable event batching. |
88
+ | `batchSize` | number | `20` | Events per batch (1–50). |
89
+ | `batchTimeout` | number | `5000` | Batch timeout (ms, 100–30000). |
90
+
91
+ ---
92
+
93
+ ## 💡 FAQ
94
+
95
+ **Q: Is Databuddy privacy-friendly?**
96
+ A: Yes! All analytics are anonymized by default. No cookies, no fingerprinting, no PII.
97
+
98
+ **Q: Can I use this in Next.js, Remix, or plain React?**
99
+ A: Yes! `<Databuddy />` works in any React app. For non-React, use the script tag directly.
100
+
101
+ **Q: How do I disable analytics in development?**
102
+ A: Use the `disabled` prop: `<Databuddy disabled={process.env.NODE_ENV === 'development'} ... />`
103
+
104
+ **Q: Where do I find my `clientId`?**
105
+ A: In your [Databuddy dashboard](https://app.databuddy.cc).
106
+
107
+ ---
108
+
109
+ ## 🧑‍💻 Troubleshooting
110
+
111
+ - **Script not loading?**
112
+ - Make sure your `clientId` is correct and the script URL is reachable.
113
+ - **No events in dashboard?**
114
+ - Check your config, especially `clientId` and network requests in the browser dev tools.
115
+ - **Type errors?**
116
+ - All config options are type-safe. Use your IDE's autocomplete for help.
117
+ - **SSR/Next.js?**
118
+ - The component is safe for SSR/React Server Components. It only injects the script on the client.
119
+
120
+ ---
121
+
122
+ ## 📚 Documentation & Support
123
+
124
+ - [Databuddy Docs](https://www.databuddy.cc/docs)
125
+ - [Dashboard](https://app.databuddy.cc)
126
+ - [Contact Support](https://www.databuddy.cc/contact)
127
+
128
+ ---
129
+
130
130
  © Databuddy. All rights reserved.
@@ -1,3 +1,5 @@
1
+ import { S as StorageInterface, F as FlagsManager, a as FlagsManagerOptions, b as FlagResult, c as FlagState, d as FlagsConfig } from '../shared/@databuddy/sdk.YfiY9DoZ.mjs';
2
+ export { e as FlagsContext } from '../shared/@databuddy/sdk.YfiY9DoZ.mjs';
1
3
  import { D as DatabuddyConfig, a as DatabuddyTracker, T as TrackFunction, b as Databuddy$1 } from '../shared/@databuddy/sdk.C8T93n5r.mjs';
2
4
  export { B as BaseEventProperties, e as DataAttributes, d as EventName, E as EventProperties, c as EventTypeMap, P as PropertiesForEvent, S as ScreenViewFunction, f as SetGlobalPropertiesFunction } from '../shared/@databuddy/sdk.C8T93n5r.mjs';
3
5
 
@@ -7,6 +9,44 @@ export { B as BaseEventProperties, e as DataAttributes, d as EventName, E as Eve
7
9
  */
8
10
  declare function detectClientId(providedClientId?: string): string | undefined;
9
11
 
12
+ declare class BrowserFlagStorage implements StorageInterface {
13
+ private ttl;
14
+ get(key: string): any;
15
+ set(key: string, value: unknown): void;
16
+ getAll(): Record<string, unknown>;
17
+ clear(): void;
18
+ private getFromLocalStorage;
19
+ private setToLocalStorage;
20
+ private isExpired;
21
+ delete(key: string): void;
22
+ deleteMultiple(keys: string[]): void;
23
+ setAll(flags: Record<string, unknown>): void;
24
+ cleanupExpired(): void;
25
+ }
26
+
27
+ declare class CoreFlagsManager implements FlagsManager {
28
+ private config;
29
+ private storage?;
30
+ private onFlagsUpdate?;
31
+ private onConfigUpdate?;
32
+ private memoryFlags;
33
+ private pendingFlags;
34
+ constructor(options: FlagsManagerOptions);
35
+ private withDefaults;
36
+ private initialize;
37
+ private loadCachedFlags;
38
+ fetchAllFlags(): Promise<void>;
39
+ getFlag(key: string): Promise<FlagResult>;
40
+ private fetchFlag;
41
+ isEnabled(key: string): FlagState;
42
+ refresh(forceClear?: boolean): void;
43
+ updateUser(user: FlagsConfig['user']): void;
44
+ updateConfig(config: FlagsConfig): void;
45
+ getMemoryFlags(): Record<string, FlagResult>;
46
+ getPendingFlags(): Set<string>;
47
+ private notifyFlagsUpdate;
48
+ }
49
+
10
50
  declare function isScriptInjected(): boolean;
11
51
  declare function createScript({ scriptUrl, sdkVersion, ...props }: DatabuddyConfig): HTMLScriptElement;
12
52
 
@@ -52,4 +92,4 @@ declare function trackError(message: string, properties?: {
52
92
  */
53
93
  declare const Databuddy: typeof Databuddy$1;
54
94
 
55
- export { Databuddy, DatabuddyConfig, DatabuddyTracker, TrackFunction, clear, createScript, detectClientId, flush, getTracker, isScriptInjected, isTrackerAvailable, track, trackError };
95
+ export { BrowserFlagStorage, CoreFlagsManager, Databuddy, DatabuddyConfig, DatabuddyTracker, FlagResult, FlagState, FlagsConfig, FlagsManager, FlagsManagerOptions, StorageInterface, TrackFunction, clear, createScript, detectClientId, flush, getTracker, isScriptInjected, isTrackerAvailable, track, trackError };
@@ -1,3 +1,5 @@
1
+ import { S as StorageInterface, F as FlagsManager, a as FlagsManagerOptions, b as FlagResult, c as FlagState, d as FlagsConfig } from '../shared/@databuddy/sdk.YfiY9DoZ.js';
2
+ export { e as FlagsContext } from '../shared/@databuddy/sdk.YfiY9DoZ.js';
1
3
  import { D as DatabuddyConfig, a as DatabuddyTracker, T as TrackFunction, b as Databuddy$1 } from '../shared/@databuddy/sdk.C8T93n5r.js';
2
4
  export { B as BaseEventProperties, e as DataAttributes, d as EventName, E as EventProperties, c as EventTypeMap, P as PropertiesForEvent, S as ScreenViewFunction, f as SetGlobalPropertiesFunction } from '../shared/@databuddy/sdk.C8T93n5r.js';
3
5
 
@@ -7,6 +9,44 @@ export { B as BaseEventProperties, e as DataAttributes, d as EventName, E as Eve
7
9
  */
8
10
  declare function detectClientId(providedClientId?: string): string | undefined;
9
11
 
12
+ declare class BrowserFlagStorage implements StorageInterface {
13
+ private ttl;
14
+ get(key: string): any;
15
+ set(key: string, value: unknown): void;
16
+ getAll(): Record<string, unknown>;
17
+ clear(): void;
18
+ private getFromLocalStorage;
19
+ private setToLocalStorage;
20
+ private isExpired;
21
+ delete(key: string): void;
22
+ deleteMultiple(keys: string[]): void;
23
+ setAll(flags: Record<string, unknown>): void;
24
+ cleanupExpired(): void;
25
+ }
26
+
27
+ declare class CoreFlagsManager implements FlagsManager {
28
+ private config;
29
+ private storage?;
30
+ private onFlagsUpdate?;
31
+ private onConfigUpdate?;
32
+ private memoryFlags;
33
+ private pendingFlags;
34
+ constructor(options: FlagsManagerOptions);
35
+ private withDefaults;
36
+ private initialize;
37
+ private loadCachedFlags;
38
+ fetchAllFlags(): Promise<void>;
39
+ getFlag(key: string): Promise<FlagResult>;
40
+ private fetchFlag;
41
+ isEnabled(key: string): FlagState;
42
+ refresh(forceClear?: boolean): void;
43
+ updateUser(user: FlagsConfig['user']): void;
44
+ updateConfig(config: FlagsConfig): void;
45
+ getMemoryFlags(): Record<string, FlagResult>;
46
+ getPendingFlags(): Set<string>;
47
+ private notifyFlagsUpdate;
48
+ }
49
+
10
50
  declare function isScriptInjected(): boolean;
11
51
  declare function createScript({ scriptUrl, sdkVersion, ...props }: DatabuddyConfig): HTMLScriptElement;
12
52
 
@@ -52,4 +92,4 @@ declare function trackError(message: string, properties?: {
52
92
  */
53
93
  declare const Databuddy: typeof Databuddy$1;
54
94
 
55
- export { Databuddy, DatabuddyConfig, DatabuddyTracker, TrackFunction, clear, createScript, detectClientId, flush, getTracker, isScriptInjected, isTrackerAvailable, track, trackError };
95
+ export { BrowserFlagStorage, CoreFlagsManager, Databuddy, DatabuddyConfig, DatabuddyTracker, FlagResult, FlagState, FlagsConfig, FlagsManager, FlagsManagerOptions, StorageInterface, TrackFunction, clear, createScript, detectClientId, flush, getTracker, isScriptInjected, isTrackerAvailable, track, trackError };
@@ -1,6 +1,6 @@
1
- import { D as Databuddy$1 } from '../shared/@databuddy/sdk.DrN7UcWM.mjs';
2
- export { d as detectClientId } from '../shared/@databuddy/sdk.DrN7UcWM.mjs';
3
- export { c as createScript, i as isScriptInjected } from '../shared/@databuddy/sdk.D3SKeeIX.mjs';
1
+ import { D as Databuddy$1 } from '../shared/@databuddy/sdk.CHuEu0ou.mjs';
2
+ export { d as detectClientId } from '../shared/@databuddy/sdk.CHuEu0ou.mjs';
3
+ export { B as BrowserFlagStorage, C as CoreFlagsManager, c as createScript, i as isScriptInjected } from '../shared/@databuddy/sdk.ItWNeH-Y.mjs';
4
4
 
5
5
  function isTrackerAvailable() {
6
6
  return typeof window !== "undefined" && (!!window.databuddy || !!window.db);
@@ -1,64 +1,17 @@
1
1
  export { b as Databuddy } from '../shared/@databuddy/sdk.C8T93n5r.mjs';
2
- import * as react from 'react';
3
2
  import { ReactNode } from 'react';
4
- import * as jotai from 'jotai';
5
-
6
- interface FlagResult {
7
- enabled: boolean;
8
- value: boolean;
9
- payload: any;
10
- reason: string;
11
- flagId?: string;
12
- flagType?: 'boolean' | 'rollout';
13
- }
14
- interface FlagsConfig {
15
- /** Client ID for flag evaluation */
16
- clientId: string;
17
- apiUrl?: string;
18
- user?: {
19
- userId?: string;
20
- email?: string;
21
- properties?: Record<string, any>;
22
- };
23
- disabled?: boolean;
24
- /** Enable debug logging */
25
- debug?: boolean;
26
- /** Skip persistent storage */
27
- skipStorage?: boolean;
28
- /** Whether session is loading */
29
- isPending?: boolean;
30
- /** Automatically fetch all flags on initialization (default: true) */
31
- autoFetch?: boolean;
32
- }
33
- interface FlagState {
34
- enabled: boolean;
35
- isLoading: boolean;
36
- isReady: boolean;
37
- }
38
- interface FlagsContext {
39
- isEnabled: (key: string) => FlagState;
40
- fetchAllFlags: () => Promise<void>;
41
- updateUser: (user: FlagsConfig['user']) => void;
42
- refresh: (forceClear?: boolean) => Promise<void>;
43
- }
3
+ import { d as FlagsConfig, c as FlagState } from '../shared/@databuddy/sdk.YfiY9DoZ.mjs';
4
+ export { b as FlagResult, e as FlagsContext } from '../shared/@databuddy/sdk.YfiY9DoZ.mjs';
44
5
 
45
6
  interface FlagsProviderProps extends FlagsConfig {
46
7
  children: ReactNode;
47
8
  }
48
- declare function FlagsProvider({ children, ...config }: FlagsProviderProps): react.FunctionComponentElement<{
49
- children?: ReactNode;
50
- store?: {
51
- get: <Value>(atom: jotai.Atom<Value>) => Value;
52
- set: <Value, Args extends unknown[], Result>(atom: jotai.WritableAtom<Value, Args, Result>, ...args: Args) => Result;
53
- sub: (atom: jotai.Atom<unknown>, listener: () => void) => () => void;
54
- };
55
- }>;
9
+ declare function FlagsProvider({ children, ...config }: FlagsProviderProps): any;
56
10
  declare function useFlags(): {
57
11
  isEnabled: (key: string) => FlagState;
58
- fetchAllFlags: () => Promise<void>;
12
+ fetchAllFlags: () => Promise<void> | undefined;
59
13
  updateUser: (user: FlagsConfig["user"]) => void;
60
14
  refresh: (forceClear?: boolean) => void;
61
15
  };
62
16
 
63
- export { FlagsProvider, useFlags };
64
- export type { FlagResult, FlagState, FlagsConfig, FlagsContext };
17
+ export { FlagState, FlagsConfig, FlagsProvider, useFlags };
@@ -1,64 +1,17 @@
1
1
  export { b as Databuddy } from '../shared/@databuddy/sdk.C8T93n5r.js';
2
- import * as react from 'react';
3
2
  import { ReactNode } from 'react';
4
- import * as jotai from 'jotai';
5
-
6
- interface FlagResult {
7
- enabled: boolean;
8
- value: boolean;
9
- payload: any;
10
- reason: string;
11
- flagId?: string;
12
- flagType?: 'boolean' | 'rollout';
13
- }
14
- interface FlagsConfig {
15
- /** Client ID for flag evaluation */
16
- clientId: string;
17
- apiUrl?: string;
18
- user?: {
19
- userId?: string;
20
- email?: string;
21
- properties?: Record<string, any>;
22
- };
23
- disabled?: boolean;
24
- /** Enable debug logging */
25
- debug?: boolean;
26
- /** Skip persistent storage */
27
- skipStorage?: boolean;
28
- /** Whether session is loading */
29
- isPending?: boolean;
30
- /** Automatically fetch all flags on initialization (default: true) */
31
- autoFetch?: boolean;
32
- }
33
- interface FlagState {
34
- enabled: boolean;
35
- isLoading: boolean;
36
- isReady: boolean;
37
- }
38
- interface FlagsContext {
39
- isEnabled: (key: string) => FlagState;
40
- fetchAllFlags: () => Promise<void>;
41
- updateUser: (user: FlagsConfig['user']) => void;
42
- refresh: (forceClear?: boolean) => Promise<void>;
43
- }
3
+ import { d as FlagsConfig, c as FlagState } from '../shared/@databuddy/sdk.YfiY9DoZ.js';
4
+ export { b as FlagResult, e as FlagsContext } from '../shared/@databuddy/sdk.YfiY9DoZ.js';
44
5
 
45
6
  interface FlagsProviderProps extends FlagsConfig {
46
7
  children: ReactNode;
47
8
  }
48
- declare function FlagsProvider({ children, ...config }: FlagsProviderProps): react.FunctionComponentElement<{
49
- children?: ReactNode;
50
- store?: {
51
- get: <Value>(atom: jotai.Atom<Value>) => Value;
52
- set: <Value, Args extends unknown[], Result>(atom: jotai.WritableAtom<Value, Args, Result>, ...args: Args) => Result;
53
- sub: (atom: jotai.Atom<unknown>, listener: () => void) => () => void;
54
- };
55
- }>;
9
+ declare function FlagsProvider({ children, ...config }: FlagsProviderProps): any;
56
10
  declare function useFlags(): {
57
11
  isEnabled: (key: string) => FlagState;
58
- fetchAllFlags: () => Promise<void>;
12
+ fetchAllFlags: () => Promise<void> | undefined;
59
13
  updateUser: (user: FlagsConfig["user"]) => void;
60
14
  refresh: (forceClear?: boolean) => void;
61
15
  };
62
16
 
63
- export { FlagsProvider, useFlags };
64
- export type { FlagResult, FlagState, FlagsConfig, FlagsContext };
17
+ export { FlagState, FlagsConfig, FlagsProvider, useFlags };