Skip to content

Commit 9edeffd

Browse files
authored
docs(node-sdk): document fallback storage names (#619)
1 parent edc774e commit 9edeffd

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

packages/node-sdk/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,14 @@ await client.initialize();
279279
```
280280

281281
The file provider stores one snapshot file per environment in the configured
282-
`directory`.
282+
`directory`, using the filename
283+
`flags-fallback-<secretKeyHash.slice(0, 16)>.json`.
283284

284285
##### Redis provider
285286

286-
The built-in Redis provider creates a Redis client automatically when omitted and uses `REDIS_URL` from the environment. It stores snapshots under the configured `keyPrefix` and uses the first 16 characters of the secret key hash in the Redis key.
287+
The built-in Redis provider creates a Redis client automatically when omitted and uses `REDIS_URL` from the environment. It stores snapshots under the configured `keyPrefix` and appends the first 16 characters of the secret key hash to that prefix.
287288

288-
Without a `keyPrefix` set, it will default to to the key `reflag:flags-fallback:${secretKeyHash}`.
289+
Without a `keyPrefix` set, it will default to the key `reflag:flags-fallback:<secretKeyHash.slice(0, 16)>`. When you provide a custom `keyPrefix`, any trailing `:` is trimmed before the hash suffix is appended.
289290

290291
```typescript
291292
import { ReflagClient, fallbackProviders } from "@reflag/node-sdk";
@@ -300,9 +301,9 @@ await client.initialize();
300301

301302
##### S3 provider
302303

303-
The built-in S3 provider works out of the box using the AWS SDK's default credential chain and region resolution. It stores the snapshot object under the configured `keyPrefix` and uses a hash of the secret key in the object name.
304+
The built-in S3 provider works out of the box using the AWS SDK's default credential chain and region resolution. It stores the snapshot object under the configured `keyPrefix` and uses the filename `flags-fallback-<secretKeyHash.slice(0, 16)>.json`.
304305

305-
Without a `keyPrefix` set, it will default to path `reflag/flags-fallback/${secretKeyHash}`.
306+
Without a `keyPrefix` set, it will default to the object key `reflag/flags-fallback/flags-fallback-<secretKeyHash.slice(0, 16)>.json`. When you provide a custom `keyPrefix`, any trailing `/` is trimmed before the filename is appended.
306307

307308
```typescript
308309
import { ReflagClient, fallbackProviders } from "@reflag/node-sdk";
@@ -319,9 +320,9 @@ await client.initialize();
319320

320321
##### GCS provider
321322

322-
The built-in GCS provider works out of the box using Google Cloud's default application credentials. It stores the snapshot object under the configured `keyPrefix` and uses a hash of the secret key in the object name.
323+
The built-in GCS provider works out of the box using Google Cloud's default application credentials. It stores the snapshot object under the configured `keyPrefix` and uses the filename `flags-fallback-<secretKeyHash.slice(0, 16)>.json`.
323324

324-
Without a `keyPrefix` set, it will default to path `reflag/flags-fallback/${secretKeyHash}`.
325+
Without a `keyPrefix` set, it will default to the object key `reflag/flags-fallback/flags-fallback-<secretKeyHash.slice(0, 16)>.json`. When you provide a custom `keyPrefix`, any trailing `/` is trimmed before the filename is appended.
325326

326327
```typescript
327328
import { ReflagClient, fallbackProviders } from "@reflag/node-sdk";

0 commit comments

Comments
 (0)