Skip to content

Commit 7beddc1

Browse files
committed
PR feedback
1 parent ecaad7b commit 7beddc1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/sdk/fastly/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ npm i @launchdarkly/fastly-server-sdk
1212
yarn add @launchdarkly/fastly-server-sdk
1313
```
1414

15+
## Usage notes
16+
17+
- The SDK must be initialized and used when processing requests, not during build-time initialization.
18+
- The SDK caches all KV data during initialization to reduce the number of backend requests needed to fetch KV data. This means changes to feature flags or segments will not be picked up during the lifecycle of a single request instance.
19+
- Events should flushed using the [`waitUntil()` method](https://js-compute-reference-docs.edgecompute.app/docs/globals/FetchEvent/prototype/waitUntil).
20+
1521
## Quickstart
1622

1723
See the full [example app](https://github.com/launchdarkly/js-core/tree/main/packages/sdk/fastly/example).

packages/sdk/fastly/src/api/EdgeFeatureStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import type {
99
import { deserializePoll, noop } from '@launchdarkly/js-server-sdk-common';
1010

1111
export interface EdgeProvider {
12-
get: (rootKey: string) => Promise<string | null | undefined>;
12+
get: (rootKey: string) => Promise<string | null>;
1313
}
1414

1515
export class EdgeFeatureStore implements LDFeatureStore {
1616
private readonly _rootKey: string;
17-
private _kvData: string | null | undefined;
17+
private _kvData: string | null = null;
1818

1919
constructor(
2020
private readonly _edgeProvider: EdgeProvider,

0 commit comments

Comments
 (0)