diff --git a/CHANGES.txt b/CHANGES.txt
index 21a4bc8..da653c9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,6 @@
+1.0.1 (July 12, 2023)
+ - Updated README file.
+
1.0.0 (June 29, 2023)
- BREAKING CHANGE: the configuration parameter `edgeConfigKey` was renamed to `edgeConfigItemKey`.
- Updated wrapper to support parsed feature flag definitions.
diff --git a/README.md b/README.md
index 7167b10..26e2537 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ Keeping feature flag definitions within an Edge Config instance enables the Spli
The package includes the storage wrapper module (`src/EdgeConfigWrapper.ts`), as well as an `example` folder to quickly get started with the integration.
-The project overall architecture is ilustrated in the following diagram:
+The project overall architecture is illustrated in the following diagram:
@@ -47,8 +47,7 @@ The project overall architecture is ilustrated in the following diagram:
wrapper: EdgeConfigWrapper({
// The Edge Config item where Split stores feature flag definitions, specified in the Split integration step
edgeConfigItemKey: '',
- // The Edge Config client. In this case, we are passing the default client
- // that reads from the Edge Config stored in process.env.EDGE_CONFIG
+ // The Edge Config client
edgeConfig: edgeConfigClient,
})
}),
diff --git a/example/pages/api/get-treatment.js b/example/pages/api/get-treatment.js
index f98f722..3c589f2 100644
--- a/example/pages/api/get-treatment.js
+++ b/example/pages/api/get-treatment.js
@@ -8,6 +8,10 @@ import { createClient } from '@vercel/edge-config';
// @REPLACE with the feature flag name you want to evaluate
const FEATURE_FLAG_NAME = 'test_split';
+// Creates a client which knows how to read from Edge Config
+// This client is defined outside of the handler so that it can be reused across requests
+const edgeConfigClient = createClient(process.env.EDGE_CONFIG);
+
// Run API route as an Edge function rather than a Serverless one, because the SDK uses Fetch API to flush data, which is available in Edge runtime but not in Serverless.
export const config = { runtime: "edge" };
@@ -27,9 +31,8 @@ export default async function handler(req, event) {
wrapper: EdgeConfigWrapper({
// The Edge Config item key where Split stores feature flag definitions, specified in the Split integration step
edgeConfigItemKey: process.env.SPLIT_EDGE_CONFIG_ITEM_KEY,
- // The Edge Config client. In this case, we are passing the default client
- // that reads from the Edge Config stored in process.env.EDGE_CONFIG
- edgeConfig: createClient(process.env.EDGE_CONFIG)
+ // The Edge Config client
+ edgeConfig: edgeConfigClient,
})
}),
// Disable or keep only ERROR log level in production, to minimize performance impact
diff --git a/package-lock.json b/package-lock.json
index 5edd359..69df5ce 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@splitsoftware/vercel-integration-utils",
- "version": "1.0.0",
+ "version": "1.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@splitsoftware/vercel-integration-utils",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^28.1.8",
diff --git a/package.json b/package.json
index 9b1c812..3e30f72 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/vercel-integration-utils",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Split SDK wrapper to integrate with Vercel Edge Config",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",