@databuddy/sdk 2.3.23 → 2.3.24

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.
@@ -1,4 +1,4 @@
1
- export { c as createScript, i as isScriptInjected } from '../shared/@databuddy/sdk.DQLu36uX.mjs';
1
+ export { c as createScript, i as isScriptInjected } from '../shared/@databuddy/sdk.z1buNzG1.mjs';
2
2
 
3
3
  function detectClientId(providedClientId) {
4
4
  if (providedClientId) {
@@ -1,4 +1,4 @@
1
- import { e as FlagsManager, f as FlagsManagerOptions, U as UserContext, d as FlagResult, b as FlagState, F as FlagsConfig } from '../shared/@databuddy/sdk.B6nwxnPC.mjs';
1
+ import { e as FlagsManager, f as FlagsManagerOptions, U as UserContext, d as FlagResult, b as FlagState, F as FlagsConfig } from '../shared/@databuddy/sdk.CdLp6SQb.mjs';
2
2
 
3
3
  interface Logger {
4
4
  info(msg: string, data?: Record<string, unknown>): void;
@@ -1,4 +1,4 @@
1
- import { e as FlagsManager, f as FlagsManagerOptions, U as UserContext, d as FlagResult, b as FlagState, F as FlagsConfig } from '../shared/@databuddy/sdk.B6nwxnPC.js';
1
+ import { e as FlagsManager, f as FlagsManagerOptions, U as UserContext, d as FlagResult, b as FlagState, F as FlagsConfig } from '../shared/@databuddy/sdk.CdLp6SQb.js';
2
2
 
3
3
  interface Logger {
4
4
  info(msg: string, data?: Record<string, unknown>): void;
@@ -1,4 +1,4 @@
1
- import { l as logger, i as isCacheValid, b as buildQueryParams, R as RequestBatcher, D as DEFAULT_RESULT, g as getCacheKey, a as isCacheStale, c as createCacheEntry, f as fetchAllFlags } from '../shared/@databuddy/sdk.DCKr2Zpd.mjs';
1
+ import { l as logger, i as isCacheValid, b as buildQueryParams, R as RequestBatcher, D as DEFAULT_RESULT, g as getCacheKey, a as isCacheStale, c as createCacheEntry, f as fetchAllFlags } from '../shared/@databuddy/sdk.CALvx07o.mjs';
2
2
 
3
3
  function createLogger(debug = false) {
4
4
  return createConsoleLogger(debug);
@@ -1,7 +1,7 @@
1
1
  import { D as DatabuddyConfig } from '../shared/@databuddy/sdk.BsF1xr6_.mjs';
2
2
  export { c as clear, f as flush, d as getAnonymousId, e as getSessionId, g as getTracker, h as getTrackingIds, j as getTrackingParams, i as isTrackerAvailable, t as track, b as trackError } from '../shared/@databuddy/sdk.BsF1xr6_.mjs';
3
3
  import React, { ReactNode } from 'react';
4
- import { F as FlagsConfig, a as FeatureState, b as FlagState, c as FlagsContext } from '../shared/@databuddy/sdk.B6nwxnPC.mjs';
4
+ import { F as FlagsConfig, a as FeatureState, b as FlagState, c as FlagsContext } from '../shared/@databuddy/sdk.CdLp6SQb.mjs';
5
5
 
6
6
  /**
7
7
  * React/Next.js component that injects the Databuddy tracking script.
@@ -1,7 +1,7 @@
1
1
  import { D as DatabuddyConfig } from '../shared/@databuddy/sdk.BsF1xr6_.js';
2
2
  export { c as clear, f as flush, d as getAnonymousId, e as getSessionId, g as getTracker, h as getTrackingIds, j as getTrackingParams, i as isTrackerAvailable, t as track, b as trackError } from '../shared/@databuddy/sdk.BsF1xr6_.js';
3
3
  import React, { ReactNode } from 'react';
4
- import { F as FlagsConfig, a as FeatureState, b as FlagState, c as FlagsContext } from '../shared/@databuddy/sdk.B6nwxnPC.js';
4
+ import { F as FlagsConfig, a as FeatureState, b as FlagState, c as FlagsContext } from '../shared/@databuddy/sdk.CdLp6SQb.js';
5
5
 
6
6
  /**
7
7
  * React/Next.js component that injects the Databuddy tracking script.
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { detectClientId } from '../core/index.mjs';
4
4
  export { clear, flush, getAnonymousId, getSessionId, getTracker, getTrackingIds, getTrackingParams, isTrackerAvailable, track, trackError } from '../core/index.mjs';
5
- import { i as isScriptInjected, c as createScript } from '../shared/@databuddy/sdk.DQLu36uX.mjs';
5
+ import { i as isScriptInjected, c as createScript } from '../shared/@databuddy/sdk.z1buNzG1.mjs';
6
6
  import React, { useRef, useMemo, useEffect, useSyncExternalStore, createContext, useContext } from 'react';
7
- import { B as BrowserFlagStorage, C as CoreFlagsManager } from '../shared/@databuddy/sdk.csCQ7WQR.mjs';
8
- import { l as logger } from '../shared/@databuddy/sdk.DCKr2Zpd.mjs';
7
+ import { B as BrowserFlagStorage, C as CoreFlagsManager } from '../shared/@databuddy/sdk.DE24-JrU.mjs';
8
+ import { l as logger } from '../shared/@databuddy/sdk.CALvx07o.mjs';
9
9
 
10
10
  function Databuddy(props) {
11
11
  const clientId = detectClientId(props.clientId);
@@ -89,6 +89,12 @@ function buildQueryParams(config, user) {
89
89
  if (u?.email) {
90
90
  params.set("email", u.email);
91
91
  }
92
+ if (u?.organizationId) {
93
+ params.set("organizationId", u.organizationId);
94
+ }
95
+ if (u?.teamId) {
96
+ params.set("teamId", u.teamId);
97
+ }
92
98
  if (u?.properties) {
93
99
  params.set("properties", JSON.stringify(u.properties));
94
100
  }
@@ -10,6 +10,10 @@ interface FlagResult {
10
10
  interface UserContext {
11
11
  userId?: string;
12
12
  email?: string;
13
+ /** Organization ID for org-level rollouts (all org members get same result) */
14
+ organizationId?: string;
15
+ /** Team ID for team-level rollouts (all team members get same result) */
16
+ teamId?: string;
13
17
  properties?: Record<string, unknown>;
14
18
  }
15
19
  /** SDK configuration */
@@ -10,6 +10,10 @@ interface FlagResult {
10
10
  interface UserContext {
11
11
  userId?: string;
12
12
  email?: string;
13
+ /** Organization ID for org-level rollouts (all org members get same result) */
14
+ organizationId?: string;
15
+ /** Team ID for team-level rollouts (all team members get same result) */
16
+ teamId?: string;
13
17
  properties?: Record<string, unknown>;
14
18
  }
15
19
  /** SDK configuration */
@@ -1,4 +1,4 @@
1
- import { l as logger, c as createCacheEntry, i as isCacheValid, b as buildQueryParams, R as RequestBatcher, a as isCacheStale, D as DEFAULT_RESULT, g as getCacheKey, f as fetchAllFlags } from './sdk.DCKr2Zpd.mjs';
1
+ import { l as logger, c as createCacheEntry, i as isCacheValid, b as buildQueryParams, R as RequestBatcher, a as isCacheStale, D as DEFAULT_RESULT, g as getCacheKey, f as fetchAllFlags } from './sdk.CALvx07o.mjs';
2
2
 
3
3
  const isBrowser = typeof window !== "undefined" && typeof localStorage !== "undefined";
4
4
  class BrowserFlagStorage {
@@ -1,4 +1,4 @@
1
- const version = "2.3.22";
1
+ const version = "2.3.23";
2
2
 
3
3
  const INJECTED_SCRIPT_ATTRIBUTE = "data-databuddy-injected";
4
4
  function isScriptInjected() {
@@ -1,7 +1,7 @@
1
1
  import * as vue from 'vue';
2
2
  import { App, ComputedRef } from 'vue';
3
- import { F as FlagsConfig, b as FlagState, d as FlagResult } from '../shared/@databuddy/sdk.B6nwxnPC.mjs';
4
- export { c as FlagsContext } from '../shared/@databuddy/sdk.B6nwxnPC.mjs';
3
+ import { F as FlagsConfig, b as FlagState, d as FlagResult } from '../shared/@databuddy/sdk.CdLp6SQb.mjs';
4
+ export { c as FlagsContext } from '../shared/@databuddy/sdk.CdLp6SQb.mjs';
5
5
 
6
6
  declare const Databuddy: vue.DefineComponent<{
7
7
  clientId?: string | undefined;
@@ -1,7 +1,7 @@
1
1
  import * as vue from 'vue';
2
2
  import { App, ComputedRef } from 'vue';
3
- import { F as FlagsConfig, b as FlagState, d as FlagResult } from '../shared/@databuddy/sdk.B6nwxnPC.js';
4
- export { c as FlagsContext } from '../shared/@databuddy/sdk.B6nwxnPC.js';
3
+ import { F as FlagsConfig, b as FlagState, d as FlagResult } from '../shared/@databuddy/sdk.CdLp6SQb.js';
4
+ export { c as FlagsContext } from '../shared/@databuddy/sdk.CdLp6SQb.js';
5
5
 
6
6
  declare const Databuddy: vue.DefineComponent<{
7
7
  clientId?: string | undefined;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, onMounted, onUnmounted, watch, reactive, watchEffect, computed } from 'vue';
2
- import { i as isScriptInjected, c as createScript } from '../shared/@databuddy/sdk.DQLu36uX.mjs';
3
- import { B as BrowserFlagStorage, C as CoreFlagsManager } from '../shared/@databuddy/sdk.csCQ7WQR.mjs';
4
- import '../shared/@databuddy/sdk.DCKr2Zpd.mjs';
2
+ import { i as isScriptInjected, c as createScript } from '../shared/@databuddy/sdk.z1buNzG1.mjs';
3
+ import { B as BrowserFlagStorage, C as CoreFlagsManager } from '../shared/@databuddy/sdk.DE24-JrU.mjs';
4
+ import '../shared/@databuddy/sdk.CALvx07o.mjs';
5
5
 
6
6
  const Databuddy = defineComponent({
7
7
  props: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databuddy/sdk",
3
- "version": "2.3.23",
3
+ "version": "2.3.24",
4
4
  "description": "Official Databuddy Analytics SDK",
5
5
  "main": "./dist/core/index.mjs",
6
6
  "types": "./dist/core/index.d.ts",