From 1e416c706f6f0274aca8f7b1ae93381385fea84a Mon Sep 17 00:00:00 2001 From: Ron Cohen Date: Sun, 19 Apr 2026 13:51:29 +0200 Subject: [PATCH] docs(node-sdk): document fallback storage names --- packages/node-sdk/README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/node-sdk/README.md b/packages/node-sdk/README.md index 051ac585..96f2840b 100644 --- a/packages/node-sdk/README.md +++ b/packages/node-sdk/README.md @@ -279,13 +279,14 @@ await client.initialize(); ``` The file provider stores one snapshot file per environment in the configured -`directory`. +`directory`, using the filename +`flags-fallback-.json`. ##### Redis provider -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. +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. -Without a `keyPrefix` set, it will default to to the key `reflag:flags-fallback:${secretKeyHash}`. +Without a `keyPrefix` set, it will default to the key `reflag:flags-fallback:`. When you provide a custom `keyPrefix`, any trailing `:` is trimmed before the hash suffix is appended. ```typescript import { ReflagClient, fallbackProviders } from "@reflag/node-sdk"; @@ -300,9 +301,9 @@ await client.initialize(); ##### S3 provider -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. +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-.json`. -Without a `keyPrefix` set, it will default to path `reflag/flags-fallback/${secretKeyHash}`. +Without a `keyPrefix` set, it will default to the object key `reflag/flags-fallback/flags-fallback-.json`. When you provide a custom `keyPrefix`, any trailing `/` is trimmed before the filename is appended. ```typescript import { ReflagClient, fallbackProviders } from "@reflag/node-sdk"; @@ -319,9 +320,9 @@ await client.initialize(); ##### GCS provider -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. +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-.json`. -Without a `keyPrefix` set, it will default to path `reflag/flags-fallback/${secretKeyHash}`. +Without a `keyPrefix` set, it will default to the object key `reflag/flags-fallback/flags-fallback-.json`. When you provide a custom `keyPrefix`, any trailing `/` is trimmed before the filename is appended. ```typescript import { ReflagClient, fallbackProviders } from "@reflag/node-sdk";