@avsbhq/node 0.1.0 → 0.3.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/README.md CHANGED
@@ -52,7 +52,7 @@ Initialize once at app boot. The server holds an in-memory datafile and refreshe
52
52
  |---|---|---|---|
53
53
  | `sdkKey` | `string` | — | **Required.** Server SDK key for the environment. |
54
54
  | `pollingInterval` | `number` | `60_000` | How often (ms) to refresh the datafile. Min `5_000`. |
55
- | `cdnHost` | `string` | `'https://cdn.avsb.app'` | CDN host for datafile fetches. |
55
+ | `cdnHost` | `string` | `'https://cdn.avsb.cloud'` | CDN host for datafile fetches. |
56
56
  | `initTimeout` | `number` | `10_000` | Max ms to wait for initial datafile fetch. |
57
57
  | `bootstrap` | `FlagDatafile` | — | Pre-fetched datafile to skip the initial network request. |
58
58
  | `streaming` | `boolean` | `false` | Enable SSE streaming for real-time datafile updates. |
package/dist/index.cjs CHANGED
@@ -160,7 +160,7 @@ function createServerTracker(options) {
160
160
  }
161
161
 
162
162
  // src/version.ts
163
- var SDK_VERSION = "0.1.0";
163
+ var SDK_VERSION = "0.3.0";
164
164
 
165
165
  // src/AvsBServer.ts
166
166
  var DEFAULT_EVENTS = {
@@ -188,7 +188,8 @@ var AvsBServer = class {
188
188
  constructor(options) {
189
189
  this.sdkKey = options.sdkKey;
190
190
  this.pollingInterval = Math.max(options.pollingInterval ?? 6e4, 5e3);
191
- this.cdnHost = options.cdnHost ?? "https://cdn.avsb.app";
191
+ const rawCdnHost = options.cdnHost ?? "https://cdn.avsb.cloud";
192
+ this.cdnHost = rawCdnHost.endsWith("/") ? rawCdnHost.slice(0, -1) : rawCdnHost;
192
193
  this.initTimeout = options.initTimeout ?? 1e4;
193
194
  this.logger = options.logger ?? noopLogger;
194
195
  this.stickyBucketService = options.stickyBucketService ?? null;
package/dist/index.d.cts CHANGED
@@ -6,7 +6,7 @@ interface AvsBServerOptions {
6
6
  sdkKey: string;
7
7
  /** Datafile polling interval in ms. Default: 60_000 (60s). Min: 5_000. */
8
8
  pollingInterval?: number;
9
- /** CDN host for datafile fetches. Default: "https://cdn.avsb.app" */
9
+ /** CDN host for datafile fetches. Default: "https://cdn.avsb.cloud" */
10
10
  cdnHost?: string;
11
11
  /** Max ms to wait for initial datafile fetch in onReady(). Default: 10_000. */
12
12
  initTimeout?: number;
@@ -241,6 +241,6 @@ declare function createDecisionLog(): DecisionLog;
241
241
  /** No-op logger — used when no custom logger is provided. */
242
242
  declare const noopLogger: Logger;
243
243
 
244
- declare const SDK_VERSION = "0.1.0";
244
+ declare const SDK_VERSION = "0.3.0";
245
245
 
246
246
  export { AvsBServer, type AvsBServerOptions, type DecisionLog, type DecisionLogEntry, type EvaluationSource, type EventOptions, InMemoryStickyBucketService, type InitResult, type Logger, type MiddlewareConfig, type OverrideEntry, type RedisLike, type RedisStickyBucketOptions, RedisStickyBucketService, type RequestAvsB, SDK_VERSION, type ServerEventMap, type ServerEventName, type ServerFlagEvaluationDetails, type StickyBucketService, type StreamingClient, type StreamingOptions, type TrackContext, type UserContext, createDecisionLog, createStreamingClient, expressMiddleware, fastifyPlugin, noopLogger };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ interface AvsBServerOptions {
6
6
  sdkKey: string;
7
7
  /** Datafile polling interval in ms. Default: 60_000 (60s). Min: 5_000. */
8
8
  pollingInterval?: number;
9
- /** CDN host for datafile fetches. Default: "https://cdn.avsb.app" */
9
+ /** CDN host for datafile fetches. Default: "https://cdn.avsb.cloud" */
10
10
  cdnHost?: string;
11
11
  /** Max ms to wait for initial datafile fetch in onReady(). Default: 10_000. */
12
12
  initTimeout?: number;
@@ -241,6 +241,6 @@ declare function createDecisionLog(): DecisionLog;
241
241
  /** No-op logger — used when no custom logger is provided. */
242
242
  declare const noopLogger: Logger;
243
243
 
244
- declare const SDK_VERSION = "0.1.0";
244
+ declare const SDK_VERSION = "0.3.0";
245
245
 
246
246
  export { AvsBServer, type AvsBServerOptions, type DecisionLog, type DecisionLogEntry, type EvaluationSource, type EventOptions, InMemoryStickyBucketService, type InitResult, type Logger, type MiddlewareConfig, type OverrideEntry, type RedisLike, type RedisStickyBucketOptions, RedisStickyBucketService, type RequestAvsB, SDK_VERSION, type ServerEventMap, type ServerEventName, type ServerFlagEvaluationDetails, type StickyBucketService, type StreamingClient, type StreamingOptions, type TrackContext, type UserContext, createDecisionLog, createStreamingClient, expressMiddleware, fastifyPlugin, noopLogger };
package/dist/index.js CHANGED
@@ -126,7 +126,7 @@ function createServerTracker(options) {
126
126
  }
127
127
 
128
128
  // src/version.ts
129
- var SDK_VERSION = "0.1.0";
129
+ var SDK_VERSION = "0.3.0";
130
130
 
131
131
  // src/AvsBServer.ts
132
132
  var DEFAULT_EVENTS = {
@@ -154,7 +154,8 @@ var AvsBServer = class {
154
154
  constructor(options) {
155
155
  this.sdkKey = options.sdkKey;
156
156
  this.pollingInterval = Math.max(options.pollingInterval ?? 6e4, 5e3);
157
- this.cdnHost = options.cdnHost ?? "https://cdn.avsb.app";
157
+ const rawCdnHost = options.cdnHost ?? "https://cdn.avsb.cloud";
158
+ this.cdnHost = rawCdnHost.endsWith("/") ? rawCdnHost.slice(0, -1) : rawCdnHost;
158
159
  this.initTimeout = options.initTimeout ?? 1e4;
159
160
  this.logger = options.logger ?? noopLogger;
160
161
  this.stickyBucketService = options.stickyBucketService ?? null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avsbhq/node",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "test:watch": "vitest"
29
29
  },
30
30
  "dependencies": {
31
- "@avsbhq/js": "^0.2.0"
31
+ "@avsbhq/js": "^0.4.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "tsup": "^8.0.0",