@replanejs/next 0.9.4 → 1.0.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 +26 -9
- package/dist/index.cjs +7 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<h1 align="center">Replane Next.js SDK</h1>
|
|
2
|
+
<p align="center">Dynamic configuration for Next.js applications with SSR support.</p>
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://cloud.replane.dev"><img src="https://img.shields.io/badge/Try-Replane%20Cloud-blue" alt="Replane Cloud"></a>
|
|
6
|
+
<a href="https://www.npmjs.com/package/@replanejs/next"><img src="https://img.shields.io/npm/v/@replanejs/next" alt="npm"></a>
|
|
7
|
+
<a href="https://github.com/replane-dev/replane-javascript/blob/main/LICENSE"><img src="https://img.shields.io/github/license/replane-dev/replane-javascript" alt="License"></a>
|
|
8
|
+
<a href="https://github.com/orgs/replane-dev/discussions"><img src="https://img.shields.io/badge/discussions-join-blue?logo=github" alt="Community"></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<picture>
|
|
12
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/replane-dev/replane/main/public/replane-window-screenshot-dark-v1.png">
|
|
13
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/replane-dev/replane/main/public/replane-window-screenshot-light-with-border-v2.jpg">
|
|
14
|
+
<img alt="Replane Screenshot" src="https://raw.githubusercontent.com/replane-dev/replane/main/public/replane-window-screenshot-light-with-border-v2.jpg">
|
|
15
|
+
</picture>
|
|
16
|
+
|
|
17
|
+
[Replane](https://github.com/replane-dev/replane) is a dynamic configuration manager. Store feature flags, app settings, and operational config in one place—with version history, optional approvals, and realtime sync to your services. No redeploys needed.
|
|
18
|
+
|
|
19
|
+
## Why Dynamic Configuration?
|
|
20
|
+
|
|
21
|
+
- **Feature flags** – toggle features, run A/B tests, roll out to user segments
|
|
22
|
+
- **Operational tuning** – adjust limits, TTLs, and timeouts without redeploying
|
|
23
|
+
- **Per-environment settings** – different values for production, staging, dev
|
|
24
|
+
- **Incident response** – instantly revert to a known-good version
|
|
25
|
+
- **Cross-service configuration** – share settings with realtime sync
|
|
26
|
+
- **Non-engineer access** – safe editing with schema validation
|
|
10
27
|
|
|
11
28
|
## Installation
|
|
12
29
|
|
package/dist/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ const __replanejs_react = __toESM(require("@replanejs/react"));
|
|
|
26
26
|
const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
|
|
27
27
|
|
|
28
28
|
//#region src/version.ts
|
|
29
|
-
const VERSION = "0.
|
|
29
|
+
const VERSION = "1.0.0";
|
|
30
30
|
const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
@@ -77,6 +77,12 @@ async function ReplaneRoot({ children,...options }) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
|
+
Object.defineProperty(exports, 'InMemoryReplaneClient', {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () {
|
|
83
|
+
return __replanejs_react.InMemoryReplaneClient;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
80
86
|
Object.defineProperty(exports, 'Replane', {
|
|
81
87
|
enumerable: true,
|
|
82
88
|
get: function () {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { GetReplaneSnapshotOptions as GetReplaneSnapshotOptions$1 } from "@replanejs/sdk";
|
|
4
|
-
import { ConnectOptions, GetConfigOptions, GetReplaneSnapshotOptions, Replane, ReplaneContext, ReplaneError, ReplaneErrorCode, ReplaneLogger, ReplaneOptions, ReplaneProvider, ReplaneProviderProps, ReplaneProviderWithClientProps, ReplaneProviderWithOptionsProps, ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
|
|
4
|
+
import { Condition, ConnectOptions, GetConfigOptions, GetReplaneSnapshotOptions, InMemoryReplaneClient, InMemoryReplaneClientOptions, Override, Replane, ReplaneContext, ReplaneError, ReplaneErrorCode, ReplaneLogger, ReplaneOptions, ReplaneProvider, ReplaneProviderProps, ReplaneProviderWithClientProps, ReplaneProviderWithOptionsProps, ReplaneSnapshot, SetConfigOptions, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
|
|
5
5
|
|
|
6
6
|
//#region src/root.d.ts
|
|
7
7
|
|
|
@@ -47,5 +47,5 @@ declare function ReplaneRoot<T extends object>({
|
|
|
47
47
|
}: ReplaneRootProps<T>): Promise<react_jsx_runtime0.JSX.Element>;
|
|
48
48
|
//# sourceMappingURL=root.d.ts.map
|
|
49
49
|
//#endregion
|
|
50
|
-
export { type ConnectOptions, type GetConfigOptions, type GetReplaneSnapshotOptions, Replane, type ReplaneContext, ReplaneError, ReplaneErrorCode, type ReplaneLogger, type ReplaneOptions, ReplaneProvider, type ReplaneProviderProps, type ReplaneProviderWithClientProps, type ReplaneProviderWithOptionsProps, ReplaneRoot, type ReplaneRootProps, type ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
|
|
50
|
+
export { type Condition, type ConnectOptions, type GetConfigOptions, type GetReplaneSnapshotOptions, InMemoryReplaneClient, type InMemoryReplaneClientOptions, type Override, Replane, type ReplaneContext, ReplaneError, ReplaneErrorCode, type ReplaneLogger, type ReplaneOptions, ReplaneProvider, type ReplaneProviderProps, type ReplaneProviderWithClientProps, type ReplaneProviderWithOptionsProps, ReplaneRoot, type ReplaneRootProps, type ReplaneSnapshot, type SetConfigOptions, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
|
|
51
51
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetReplaneSnapshotOptions as GetReplaneSnapshotOptions$1 } from "@replanejs/sdk";
|
|
2
|
-
import { ConnectOptions, GetConfigOptions, GetReplaneSnapshotOptions, Replane, ReplaneContext, ReplaneError, ReplaneErrorCode, ReplaneLogger, ReplaneOptions, ReplaneProvider, ReplaneProviderProps, ReplaneProviderWithClientProps, ReplaneProviderWithOptionsProps, ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
|
|
2
|
+
import { Condition, ConnectOptions, GetConfigOptions, GetReplaneSnapshotOptions, InMemoryReplaneClient, InMemoryReplaneClientOptions, Override, Replane, ReplaneContext, ReplaneError, ReplaneErrorCode, ReplaneLogger, ReplaneOptions, ReplaneProvider, ReplaneProviderProps, ReplaneProviderWithClientProps, ReplaneProviderWithOptionsProps, ReplaneSnapshot, SetConfigOptions, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
|
|
@@ -47,5 +47,5 @@ declare function ReplaneRoot<T extends object>({
|
|
|
47
47
|
}: ReplaneRootProps<T>): Promise<react_jsx_runtime0.JSX.Element>;
|
|
48
48
|
//# sourceMappingURL=root.d.ts.map
|
|
49
49
|
//#endregion
|
|
50
|
-
export { type ConnectOptions, type GetConfigOptions, type GetReplaneSnapshotOptions, Replane, type ReplaneContext, ReplaneError, ReplaneErrorCode, type ReplaneLogger, type ReplaneOptions, ReplaneProvider, type ReplaneProviderProps, type ReplaneProviderWithClientProps, type ReplaneProviderWithOptionsProps, ReplaneRoot, type ReplaneRootProps, type ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
|
|
50
|
+
export { type Condition, type ConnectOptions, type GetConfigOptions, type GetReplaneSnapshotOptions, InMemoryReplaneClient, type InMemoryReplaneClientOptions, type Override, Replane, type ReplaneContext, ReplaneError, ReplaneErrorCode, type ReplaneLogger, type ReplaneOptions, ReplaneProvider, type ReplaneProviderProps, type ReplaneProviderWithClientProps, type ReplaneProviderWithOptionsProps, ReplaneRoot, type ReplaneRootProps, type ReplaneSnapshot, type SetConfigOptions, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
|
|
51
51
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getReplaneSnapshot as getReplaneSnapshot$1 } from "@replanejs/sdk";
|
|
2
|
-
import { Replane, ReplaneError, ReplaneErrorCode, ReplaneProvider, ReplaneProvider as ReplaneProvider$1, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
|
|
2
|
+
import { InMemoryReplaneClient, Replane, ReplaneError, ReplaneErrorCode, ReplaneProvider, ReplaneProvider as ReplaneProvider$1, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/version.ts
|
|
6
|
-
const VERSION = "0.
|
|
6
|
+
const VERSION = "1.0.0";
|
|
7
7
|
const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -54,5 +54,5 @@ async function ReplaneRoot({ children,...options }) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
//#endregion
|
|
57
|
-
export { Replane, ReplaneError, ReplaneErrorCode, ReplaneProvider, ReplaneRoot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
|
|
57
|
+
export { InMemoryReplaneClient, Replane, ReplaneError, ReplaneErrorCode, ReplaneProvider, ReplaneRoot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
|
|
58
58
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReplaneProvider"],"sources":["../src/version.ts","../src/root.tsx"],"sourcesContent":["// Auto-generated - do not edit manually\nexport const VERSION = \"0.
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReplaneProvider"],"sources":["../src/version.ts","../src/root.tsx"],"sourcesContent":["// Auto-generated - do not edit manually\nexport const VERSION = \"1.0.0\";\nexport const DEFAULT_AGENT = `replane-js-next/${VERSION}`;\n","/**\n * Server-side utilities for Next.js\n * Use this module in Server Components, getServerSideProps, or getStaticProps\n */\n\nimport type { ReactNode } from \"react\";\nimport { getReplaneSnapshot, type GetReplaneSnapshotOptions } from \"@replanejs/sdk\";\nimport { ReplaneProvider } from \"@replanejs/react\";\nimport { DEFAULT_AGENT } from \"./version\";\n\n/**\n * Props for ReplaneRoot server component\n */\nexport interface ReplaneRootProps<T extends object> extends GetReplaneSnapshotOptions<T> {\n /**\n * React children to render inside the provider\n */\n children: ReactNode;\n}\n\n/**\n * Server component that fetches Replane configs and provides them to the app.\n * This is the simplest way to set up Replane in Next.js App Router.\n *\n * @example Basic usage in layout.tsx\n * ```tsx\n * // app/layout.tsx\n * import { ReplaneRoot } from \"@replanejs/next\";\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * <ReplaneRoot\n * connection={{\n * baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,\n * sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,\n * }}\n * >\n * {children}\n * </ReplaneRoot>\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport async function ReplaneRoot<T extends object>({ children, ...options }: ReplaneRootProps<T>) {\n const { connection: originalConnection, ...replaneOptions } = options;\n const connectionWithAgent = originalConnection\n ? {\n ...originalConnection,\n agent: originalConnection.agent ?? DEFAULT_AGENT,\n }\n : null;\n const snapshot = await getReplaneSnapshot({\n ...replaneOptions,\n connection: connectionWithAgent,\n });\n\n return (\n <ReplaneProvider connection={connectionWithAgent} snapshot={snapshot} {...replaneOptions}>\n {children}\n </ReplaneProvider>\n );\n}\n"],"mappings":";;;;;AACA,MAAa,UAAU;AACvB,MAAa,iBAAiB,kBAAkB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC6CxD,eAAsB,YAA8B,EAAE,SAAU,GAAG,SAA8B,EAAE;CACjG,MAAM,EAAE,YAAY,mBAAoB,GAAG,gBAAgB,GAAG;CAC9D,MAAM,sBAAsB,qBACxB;EACE,GAAG;EACH,OAAO,mBAAmB,SAAS;CACpC,IACD;CACJ,MAAM,WAAW,MAAM,qBAAmB;EACxC,GAAG;EACH,YAAY;CACb,EAAC;AAEF,wBACE,IAACA;EAAgB,YAAY;EAA+B;EAAU,GAAI;EACvE;GACe;AAErB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replanejs/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Next.js SDK for Replane - feature flags and remote configuration with SSR support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
"react": ">=18.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@replanejs/
|
|
49
|
-
"@replanejs/
|
|
48
|
+
"@replanejs/sdk": "^1.0.0",
|
|
49
|
+
"@replanejs/react": "^1.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^22.19.3",
|
|
53
|
-
"@types/react": "^
|
|
54
|
-
"@types/react-dom": "^
|
|
53
|
+
"@types/react": "^19.2.7",
|
|
54
|
+
"@types/react-dom": "^19.2.3",
|
|
55
55
|
"next": "^15.0.0",
|
|
56
|
-
"react": "^
|
|
57
|
-
"react-dom": "^
|
|
56
|
+
"react": "^19.2.3",
|
|
57
|
+
"react-dom": "^19.2.3",
|
|
58
58
|
"tsdown": "^0.11.9",
|
|
59
59
|
"typescript": "^5.4.0",
|
|
60
60
|
"vitest": "^3.2.4"
|