@replanejs/next 0.9.0 → 0.9.2

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 CHANGED
@@ -34,7 +34,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
34
34
  <html lang="en">
35
35
  <body>
36
36
  <ReplaneRoot<AppConfigs>
37
- options={{
37
+ connection={{
38
38
  baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,
39
39
  sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,
40
40
  }}
@@ -84,7 +84,7 @@ export default function MyApp({ Component, pageProps, replaneSnapshot }: AppProp
84
84
  return (
85
85
  <ReplaneProvider
86
86
  snapshot={replaneSnapshot}
87
- options={{
87
+ connection={{
88
88
  baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,
89
89
  sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,
90
90
  }}
@@ -99,8 +99,10 @@ MyApp.getInitialProps = async (appContext: AppContext) => {
99
99
  const appProps = await App.getInitialProps(appContext);
100
100
 
101
101
  const replaneSnapshot = await getReplaneSnapshot<AppConfigs>({
102
- baseUrl: process.env.REPLANE_BASE_URL!,
103
- sdkKey: process.env.REPLANE_SDK_KEY!,
102
+ connection: {
103
+ baseUrl: process.env.REPLANE_BASE_URL!,
104
+ sdkKey: process.env.REPLANE_SDK_KEY!,
105
+ },
104
106
  });
105
107
 
106
108
  return { ...appProps, replaneSnapshot };
@@ -174,22 +176,29 @@ export function ConfigDisplay() {
174
176
  }
175
177
  ```
176
178
 
177
- ## Client Options
179
+ ## Provider Props
180
+
181
+ | Prop | Type | Required | Description |
182
+ | ------------ | ------------------------- | -------- | ------------------------------------------------------- |
183
+ | `connection` | `ConnectOptions` | No | Connection options (see below) |
184
+ | `defaults` | `Record<string, unknown>` | No | Default values if server is unavailable |
185
+ | `context` | `Record<string, unknown>` | No | Default context for override evaluations |
186
+ | `snapshot` | `ReplaneSnapshot` | No | Snapshot for SSR hydration |
187
+ | `logger` | `ReplaneLogger` | No | Custom logger (default: console) |
178
188
 
179
- The `options` prop accepts the following options:
189
+ ## Connection Options
190
+
191
+ The `connection` prop accepts the following options:
180
192
 
181
193
  | Option | Type | Required | Description |
182
194
  | --------------------- | --------------------- | -------- | ---------------------------------------- |
183
195
  | `baseUrl` | `string` | Yes | Replane server URL |
184
196
  | `sdkKey` | `string` | Yes | SDK key for authentication |
185
- | `context` | `Record<string, any>` | No | Default context for override evaluations |
186
- | `defaults` | `Record<string, any>` | No | Default values if server is unavailable |
187
197
  | `connectTimeoutMs` | `number` | No | SDK connection timeout (default: 5000) |
188
198
  | `requestTimeoutMs` | `number` | No | Timeout for SSE requests (default: 2000) |
189
199
  | `retryDelayMs` | `number` | No | Base delay between retries (default: 200)|
190
200
  | `inactivityTimeoutMs` | `number` | No | SSE inactivity timeout (default: 30000) |
191
201
  | `fetchFn` | `typeof fetch` | No | Custom fetch implementation |
192
- | `logger` | `ReplaneLogger` | No | Custom logger (default: console) |
193
202
 
194
203
  See [`@replanejs/sdk` documentation](https://github.com/replane-dev/replane-javascript/tree/main/packages/sdk#api) for more details.
195
204
 
@@ -203,10 +212,9 @@ Server component for App Router that fetches configs and provides them to the ap
203
212
 
204
213
  ```tsx
205
214
  <ReplaneRoot<AppConfigs>
206
- options={{
215
+ connection={{
207
216
  baseUrl: string;
208
217
  sdkKey: string;
209
- // ... other ReplaneClientOptions
210
218
  }}
211
219
  >
212
220
  {children}
@@ -220,7 +228,7 @@ Client-side provider for Pages Router or custom setups.
220
228
  ```tsx
221
229
  <ReplaneProvider
222
230
  snapshot={replaneSnapshot}
223
- options={{
231
+ connection={{
224
232
  baseUrl: string;
225
233
  sdkKey: string;
226
234
  }}
@@ -275,8 +283,10 @@ Fetches a snapshot of all configs. Use in `getServerSideProps`, `getStaticProps`
275
283
 
276
284
  ```tsx
277
285
  const snapshot = await getReplaneSnapshot<AppConfigs>({
278
- baseUrl: process.env.REPLANE_BASE_URL!,
279
- sdkKey: process.env.REPLANE_SDK_KEY!,
286
+ connection: {
287
+ baseUrl: process.env.REPLANE_BASE_URL!,
288
+ sdkKey: process.env.REPLANE_SDK_KEY!,
289
+ },
280
290
  // by default, getReplaneSnapshot will reuse the created client for 60 seconds for fast subsequent calls, the client will be syncing with the server in the background during this time
281
291
  keepAliveMs: 60_000,
282
292
  });
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.9.0";
29
+ const VERSION = "0.9.2";
30
30
  const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
31
31
 
32
32
  //#endregion
@@ -45,7 +45,7 @@ const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
45
45
  * <html>
46
46
  * <body>
47
47
  * <ReplaneRoot
48
- * options={{
48
+ * connection={{
49
49
  * baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,
50
50
  * sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,
51
51
  * }}
@@ -58,15 +58,20 @@ const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
58
58
  * }
59
59
  * ```
60
60
  */
61
- async function ReplaneRoot({ options, children }) {
62
- const optionsWithAgent = {
63
- ...options,
64
- agent: options.agent ?? DEFAULT_AGENT
65
- };
66
- const snapshot = await (0, __replanejs_sdk.getReplaneSnapshot)(optionsWithAgent);
61
+ async function ReplaneRoot({ children,...options }) {
62
+ const { connection: originalConnection,...replaneOptions } = options;
63
+ const connectionWithAgent = originalConnection ? {
64
+ ...originalConnection,
65
+ agent: originalConnection.agent ?? DEFAULT_AGENT
66
+ } : null;
67
+ const snapshot = await (0, __replanejs_sdk.getReplaneSnapshot)({
68
+ ...replaneOptions,
69
+ connection: connectionWithAgent
70
+ });
67
71
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__replanejs_react.ReplaneProvider, {
68
- options: optionsWithAgent,
72
+ connection: connectionWithAgent,
69
73
  snapshot,
74
+ ...replaneOptions,
70
75
  children
71
76
  });
72
77
  }
package/dist/index.d.cts CHANGED
@@ -1,18 +1,14 @@
1
1
  import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
  import { ReactNode } from "react";
3
- import { ConnectOptions, GetConfigOptions, GetReplaneSnapshotOptions, Replane, ReplaneContext, ReplaneError, ReplaneErrorCode, ReplaneLogger, ReplaneOptions, ReplaneProvider, ReplaneProviderOptions, ReplaneProviderOptions as ReplaneProviderOptions$1, ReplaneProviderProps, ReplaneProviderWithClientProps, ReplaneProviderWithOptionsProps, ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
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
5
 
5
6
  //#region src/root.d.ts
6
7
 
7
8
  /**
8
9
  * Props for ReplaneRoot server component
9
10
  */
10
- interface ReplaneRootProps<T extends object> {
11
- /**
12
- * Options for Replane client.
13
- * Used for both server-side fetching and client-side live updates.
14
- */
15
- options: ReplaneProviderOptions$1<T>;
11
+ interface ReplaneRootProps<T extends object> extends GetReplaneSnapshotOptions$1<T> {
16
12
  /**
17
13
  * React children to render inside the provider
18
14
  */
@@ -32,7 +28,7 @@ interface ReplaneRootProps<T extends object> {
32
28
  * <html>
33
29
  * <body>
34
30
  * <ReplaneRoot
35
- * options={{
31
+ * connection={{
36
32
  * baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,
37
33
  * sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,
38
34
  * }}
@@ -46,10 +42,10 @@ interface ReplaneRootProps<T extends object> {
46
42
  * ```
47
43
  */
48
44
  declare function ReplaneRoot<T extends object>({
49
- options,
50
- children
45
+ children,
46
+ ...options
51
47
  }: ReplaneRootProps<T>): Promise<react_jsx_runtime0.JSX.Element>;
52
48
  //# sourceMappingURL=root.d.ts.map
53
49
  //#endregion
54
- export { type ConnectOptions, type GetConfigOptions, type GetReplaneSnapshotOptions, Replane, type ReplaneContext, ReplaneError, ReplaneErrorCode, type ReplaneLogger, type ReplaneOptions, ReplaneProvider, type ReplaneProviderOptions, type ReplaneProviderProps, type ReplaneProviderWithClientProps, type ReplaneProviderWithOptionsProps, ReplaneRoot, type ReplaneRootProps, type ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
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 };
55
51
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAsBY,UATK,gBASL,CAAA,UAAA,MAAA,CAAA,CAAA;EAAS;AA8BrB;;;EAA6D,OAAE,EAlCpD,wBAkCoD,CAlC7B,CAkC6B,CAAA;EAAQ;;;EAAuB,QAAA,EA9BlF,SA8BkF;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAxE;;;GAAqD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;AAIY,UAJK,gBAIL,CAAA,UAAA,MAAA,CAAA,SAJgD,2BAIhD,CAJ0E,CAI1E,CAAA,CAAA;EAAS;AAJgE;AAkCrF;EAAiC,QAAA,EA9BrB,SA8BqB;;;;;;AAAgE;;;;;;;;;;;;;;;;;;;;;;;iBAA3E;;;GAAwD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { ConnectOptions, GetConfigOptions, GetReplaneSnapshotOptions, Replane, ReplaneContext, ReplaneError, ReplaneErrorCode, ReplaneLogger, ReplaneOptions, ReplaneProvider, ReplaneProviderOptions, ReplaneProviderOptions as ReplaneProviderOptions$1, ReplaneProviderProps, ReplaneProviderWithClientProps, ReplaneProviderWithOptionsProps, ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
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
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
4
  import { ReactNode } from "react";
4
5
 
@@ -7,12 +8,7 @@ import { ReactNode } from "react";
7
8
  /**
8
9
  * Props for ReplaneRoot server component
9
10
  */
10
- interface ReplaneRootProps<T extends object> {
11
- /**
12
- * Options for Replane client.
13
- * Used for both server-side fetching and client-side live updates.
14
- */
15
- options: ReplaneProviderOptions$1<T>;
11
+ interface ReplaneRootProps<T extends object> extends GetReplaneSnapshotOptions$1<T> {
16
12
  /**
17
13
  * React children to render inside the provider
18
14
  */
@@ -32,7 +28,7 @@ interface ReplaneRootProps<T extends object> {
32
28
  * <html>
33
29
  * <body>
34
30
  * <ReplaneRoot
35
- * options={{
31
+ * connection={{
36
32
  * baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,
37
33
  * sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,
38
34
  * }}
@@ -46,10 +42,10 @@ interface ReplaneRootProps<T extends object> {
46
42
  * ```
47
43
  */
48
44
  declare function ReplaneRoot<T extends object>({
49
- options,
50
- children
45
+ children,
46
+ ...options
51
47
  }: ReplaneRootProps<T>): Promise<react_jsx_runtime0.JSX.Element>;
52
48
  //# sourceMappingURL=root.d.ts.map
53
49
  //#endregion
54
- export { type ConnectOptions, type GetConfigOptions, type GetReplaneSnapshotOptions, Replane, type ReplaneContext, ReplaneError, ReplaneErrorCode, type ReplaneLogger, type ReplaneOptions, ReplaneProvider, type ReplaneProviderOptions, type ReplaneProviderProps, type ReplaneProviderWithClientProps, type ReplaneProviderWithOptionsProps, ReplaneRoot, type ReplaneRootProps, type ReplaneSnapshot, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane };
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 };
55
51
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAsBY,UATK,gBASL,CAAA,UAAA,MAAA,CAAA,CAAA;EAAS;AA8BrB;;;EAA6D,OAAE,EAlCpD,wBAkCoD,CAlC7B,CAkC6B,CAAA;EAAQ;;;EAAuB,QAAA,EA9BlF,SA8BkF;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAxE;;;GAAqD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;AAIY,UAJK,gBAIL,CAAA,UAAA,MAAA,CAAA,SAJgD,2BAIhD,CAJ0E,CAI1E,CAAA,CAAA;EAAS;AAJgE;AAkCrF;EAAiC,QAAA,EA9BrB,SA8BqB;;;;;;AAAgE;;;;;;;;;;;;;;;;;;;;;;;iBAA3E;;;GAAwD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { Replane, ReplaneError, ReplaneErrorCode, ReplaneProvider, ReplaneProvid
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/version.ts
6
- const VERSION = "0.9.0";
6
+ const VERSION = "0.9.2";
7
7
  const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
8
8
 
9
9
  //#endregion
@@ -22,7 +22,7 @@ const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
22
22
  * <html>
23
23
  * <body>
24
24
  * <ReplaneRoot
25
- * options={{
25
+ * connection={{
26
26
  * baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,
27
27
  * sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,
28
28
  * }}
@@ -35,15 +35,20 @@ const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
35
35
  * }
36
36
  * ```
37
37
  */
38
- async function ReplaneRoot({ options, children }) {
39
- const optionsWithAgent = {
40
- ...options,
41
- agent: options.agent ?? DEFAULT_AGENT
42
- };
43
- const snapshot = await getReplaneSnapshot$1(optionsWithAgent);
38
+ async function ReplaneRoot({ children,...options }) {
39
+ const { connection: originalConnection,...replaneOptions } = options;
40
+ const connectionWithAgent = originalConnection ? {
41
+ ...originalConnection,
42
+ agent: originalConnection.agent ?? DEFAULT_AGENT
43
+ } : null;
44
+ const snapshot = await getReplaneSnapshot$1({
45
+ ...replaneOptions,
46
+ connection: connectionWithAgent
47
+ });
44
48
  return /* @__PURE__ */ jsx(ReplaneProvider$1, {
45
- options: optionsWithAgent,
49
+ connection: connectionWithAgent,
46
50
  snapshot,
51
+ ...replaneOptions,
47
52
  children
48
53
  });
49
54
  }
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.9.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 } from \"@replanejs/sdk\";\nimport { ReplaneProvider, type ReplaneProviderOptions } from \"@replanejs/react\";\nimport { DEFAULT_AGENT } from \"./version\";\n\n/**\n * Props for ReplaneRoot server component\n */\nexport interface ReplaneRootProps<T extends object> {\n /**\n * Options for Replane client.\n * Used for both server-side fetching and client-side live updates.\n */\n options: ReplaneProviderOptions<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 * options={{\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>({ options, children }: ReplaneRootProps<T>) {\n const optionsWithAgent = {\n ...options,\n agent: options.agent ?? DEFAULT_AGENT,\n };\n const snapshot = await getReplaneSnapshot(optionsWithAgent);\n\n return (\n <ReplaneProvider options={optionsWithAgent} snapshot={snapshot}>\n {children}\n </ReplaneProvider>\n );\n}\n"],"mappings":";;;;;AACA,MAAa,UAAU;AACvB,MAAa,iBAAiB,kBAAkB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkDxD,eAAsB,YAA8B,EAAE,SAAS,UAA+B,EAAE;CAC9F,MAAM,mBAAmB;EACvB,GAAG;EACH,OAAO,QAAQ,SAAS;CACzB;CACD,MAAM,WAAW,MAAM,qBAAmB,iBAAiB;AAE3D,wBACE,IAACA;EAAgB,SAAS;EAA4B;EACnD;GACe;AAErB"}
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.9.2\";\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.9.0",
3
+ "version": "0.9.2",
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,8 +45,8 @@
45
45
  "react": ">=18.0.0"
46
46
  },
47
47
  "dependencies": {
48
- "@replanejs/sdk": "^0.9.0",
49
- "@replanejs/react": "^0.9.0"
48
+ "@replanejs/react": "^0.9.2",
49
+ "@replanejs/sdk": "^0.9.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.19.3",