@vercel/flags-core 1.5.0-dde2adb-20260526050633 → 1.5.1

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,12 +1,25 @@
1
- import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-C70GeY3G.js';
2
- export { c as Packed, R as Reason, V as Value } from './types-C70GeY3G.js';
1
+ import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DkVz6AOY.js';
2
+ export { c as Packed, R as Reason, V as Value } from './types-DkVz6AOY.js';
3
+
4
+ type BundledDefinitionsLookup = {
5
+ type: 'sdk-key';
6
+ sdkKey: string;
7
+ } | {
8
+ type: 'project-id';
9
+ projectId: string;
10
+ };
11
+ interface Auth {
12
+ sdkKey?: string;
13
+ resolveToken(): Promise<string>;
14
+ resolveBundledDefinitionsLookup(): Promise<BundledDefinitionsLookup>;
15
+ }
3
16
 
4
17
  /**
5
18
  * Configuration options for Controller
6
19
  */
7
20
  type ControllerOptions = {
8
- /** SDK key for authentication (must start with "vf_") */
9
- sdkKey: string;
21
+ /** Authentication which resolves the token for requests */
22
+ auth: Auth;
10
23
  /**
11
24
  * Initial datafile to use immediately
12
25
  * - At runtime: used while waiting for stream/poll, then updated in background
@@ -192,7 +205,7 @@ declare class Controller implements ControllerInterface {
192
205
  /**
193
206
  * Options for createClient
194
207
  */
195
- type CreateClientOptions = Omit<ControllerOptions, 'sdkKey'>;
208
+ type CreateClientOptions = Omit<ControllerOptions, 'auth'>;
196
209
 
197
210
  /**
198
211
  * Error thrown when the fallback definitions file does not exist.
@@ -228,6 +241,6 @@ _visited?: Set<string>): EvaluationResult<T>;
228
241
 
229
242
  declare const flagsClient: FlagsClient;
230
243
  declare const resetDefaultFlagsClient: () => void;
231
- declare const createClient: <Entities = Record<string, unknown>>(sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient<Entities>;
244
+ declare const createClient: <Entities = Record<string, unknown>>(sdkKeyOrConnectionString?: string, options?: CreateClientOptions) => FlagsClient<Entities>;
232
245
 
233
246
  export { BundledDefinitions, Controller, type ControllerOptions, type CreateClientOptions, Datafile, DatafileInput, EvaluationParams, EvaluationResult, FallbackEntryNotFoundError, FallbackNotFoundError, Controller as FlagNetworkDataSource, type ControllerOptions as FlagNetworkDataSourceOptions, FlagsClient, PollingOptions, StreamOptions, createClient, evaluate, flagsClient, resetDefaultFlagsClient };
@@ -7,7 +7,7 @@ import {
7
7
  evaluate,
8
8
  flagsClient,
9
9
  resetDefaultFlagsClient
10
- } from "./chunk-UICJ4U6H.js";
10
+ } from "./chunk-4B7CLR4J.js";
11
11
  export {
12
12
  Controller,
13
13
  FallbackEntryNotFoundError,
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
2
2
 
3
3
 
4
- var _chunkZHIY5NVJcjs = require('./chunk-ZHIY5NVJ.cjs');
4
+ var _chunkAXRUQULCcjs = require('./chunk-AXRUQULC.cjs');
5
5
 
6
6
  // src/openfeature.make.ts
7
7
 
@@ -150,7 +150,7 @@ function make(createClient2, defaultFlagsClient) {
150
150
  }
151
151
 
152
152
  // src/openfeature.default.ts
153
- var VercelProvider = make(_chunkZHIY5NVJcjs.createClient, _chunkZHIY5NVJcjs.flagsClient);
153
+ var VercelProvider = make(_chunkAXRUQULCcjs.createClient, _chunkAXRUQULCcjs.flagsClient);
154
154
 
155
155
 
156
156
  exports.VercelProvider = VercelProvider;
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-C70GeY3G.cjs';
1
+ import { F as FlagsClient } from './types-DkVz6AOY.cjs';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-C70GeY3G.js';
1
+ import { F as FlagsClient } from './types-DkVz6AOY.js';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createClient,
3
3
  flagsClient
4
- } from "./chunk-CX2U3ZTN.js";
4
+ } from "./chunk-ITF6ZJ32.js";
5
5
 
6
6
  // src/openfeature.make.ts
7
7
  import {
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
2
2
 
3
3
 
4
- var _chunkXINPOF5Ocjs = require('./chunk-XINPOF5O.cjs');
4
+ var _chunkJTIP7QPDcjs = require('./chunk-JTIP7QPD.cjs');
5
5
 
6
6
  // src/openfeature.make.ts
7
7
 
@@ -150,7 +150,7 @@ function make(createClient2, defaultFlagsClient) {
150
150
  }
151
151
 
152
152
  // src/openfeature.next-js.ts
153
- var VercelProvider = make(_chunkXINPOF5Ocjs.createClient, _chunkXINPOF5Ocjs.flagsClient);
153
+ var VercelProvider = make(_chunkJTIP7QPDcjs.createClient, _chunkJTIP7QPDcjs.flagsClient);
154
154
 
155
155
 
156
156
  exports.VercelProvider = VercelProvider;
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-C70GeY3G.cjs';
1
+ import { F as FlagsClient } from './types-DkVz6AOY.cjs';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-C70GeY3G.js';
1
+ import { F as FlagsClient } from './types-DkVz6AOY.js';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createClient,
3
3
  flagsClient
4
- } from "./chunk-UICJ4U6H.js";
4
+ } from "./chunk-4B7CLR4J.js";
5
5
 
6
6
  // src/openfeature.make.ts
7
7
  import {
@@ -104,11 +104,12 @@ type BulkEvaluateInput<T = Value> = {
104
104
  */
105
105
  type FlagsClient<Entities = Record<string, unknown>> = {
106
106
  /**
107
- * Origin information for this client (provider and sdkKey)
107
+ * Origin information for this client.
108
+ * sdkKey is only present when the client was explicitly created with one.
108
109
  */
109
110
  origin?: {
110
111
  provider: string;
111
- sdkKey: string;
112
+ sdkKey?: string;
112
113
  };
113
114
  /**
114
115
  * Evaluate a feature flag
@@ -104,11 +104,12 @@ type BulkEvaluateInput<T = Value> = {
104
104
  */
105
105
  type FlagsClient<Entities = Record<string, unknown>> = {
106
106
  /**
107
- * Origin information for this client (provider and sdkKey)
107
+ * Origin information for this client.
108
+ * sdkKey is only present when the client was explicitly created with one.
108
109
  */
109
110
  origin?: {
110
111
  provider: string;
111
- sdkKey: string;
112
+ sdkKey?: string;
112
113
  };
113
114
  /**
114
115
  * Evaluate a feature flag
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/flags-core",
3
- "version": "1.5.0-dde2adb-20260526050633",
3
+ "version": "1.5.1",
4
4
  "description": "A server-side client for Vercel Flags",
5
5
  "keywords": [
6
6
  "vercel",
@@ -66,6 +66,7 @@
66
66
  ],
67
67
  "dependencies": {
68
68
  "@vercel/functions": "^3.4.3",
69
+ "@vercel/oidc": "3.5.0",
69
70
  "jose": "5.2.1",
70
71
  "js-xxhash": "4.0.0"
71
72
  },