@dyanet/nextjs-config-aws 1.0.0-beta.1

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.
Files changed (50) hide show
  1. package/README.md +458 -0
  2. package/dist/cjs/client/env.js +104 -0
  3. package/dist/cjs/client/env.js.map +1 -0
  4. package/dist/cjs/client/index.js +15 -0
  5. package/dist/cjs/client/index.js.map +1 -0
  6. package/dist/cjs/components/index.js +11 -0
  7. package/dist/cjs/components/index.js.map +1 -0
  8. package/dist/cjs/components/public-env-script.js +145 -0
  9. package/dist/cjs/components/public-env-script.js.map +1 -0
  10. package/dist/cjs/index.js +46 -0
  11. package/dist/cjs/index.js.map +1 -0
  12. package/dist/cjs/server/config-provider.js +99 -0
  13. package/dist/cjs/server/config-provider.js.map +1 -0
  14. package/dist/cjs/server/get-config.js +153 -0
  15. package/dist/cjs/server/get-config.js.map +1 -0
  16. package/dist/cjs/server/index.js +17 -0
  17. package/dist/cjs/server/index.js.map +1 -0
  18. package/dist/esm/client/env.js +98 -0
  19. package/dist/esm/client/env.js.map +1 -0
  20. package/dist/esm/client/index.js +8 -0
  21. package/dist/esm/client/index.js.map +1 -0
  22. package/dist/esm/components/index.js +5 -0
  23. package/dist/esm/components/index.js.map +1 -0
  24. package/dist/esm/components/public-env-script.js +107 -0
  25. package/dist/esm/components/public-env-script.js.map +1 -0
  26. package/dist/esm/index.js +15 -0
  27. package/dist/esm/index.js.map +1 -0
  28. package/dist/esm/server/config-provider.js +95 -0
  29. package/dist/esm/server/config-provider.js.map +1 -0
  30. package/dist/esm/server/get-config.js +145 -0
  31. package/dist/esm/server/get-config.js.map +1 -0
  32. package/dist/esm/server/index.js +6 -0
  33. package/dist/esm/server/index.js.map +1 -0
  34. package/dist/types/client/env.d.ts +116 -0
  35. package/dist/types/client/env.d.ts.map +1 -0
  36. package/dist/types/client/index.d.ts +8 -0
  37. package/dist/types/client/index.d.ts.map +1 -0
  38. package/dist/types/components/index.d.ts +5 -0
  39. package/dist/types/components/index.d.ts.map +1 -0
  40. package/dist/types/components/public-env-script.d.ts +91 -0
  41. package/dist/types/components/public-env-script.d.ts.map +1 -0
  42. package/dist/types/index.d.ts +13 -0
  43. package/dist/types/index.d.ts.map +1 -0
  44. package/dist/types/server/config-provider.d.ts +80 -0
  45. package/dist/types/server/config-provider.d.ts.map +1 -0
  46. package/dist/types/server/get-config.d.ts +86 -0
  47. package/dist/types/server/get-config.d.ts.map +1 -0
  48. package/dist/types/server/index.d.ts +6 -0
  49. package/dist/types/server/index.d.ts.map +1 -0
  50. package/package.json +90 -0
package/README.md ADDED
@@ -0,0 +1,458 @@
1
+ # @dyanet/nextjs-config-aws
2
+
3
+ Next.js adapter for AWS configuration management. A thin wrapper around [@dyanet/config-aws](../config-aws) that provides server-side configuration loading, React context providers, and runtime environment variable support.
4
+
5
+ ## Features
6
+
7
+ - **Server Components** - Load configuration in Server Components and API routes
8
+ - **Runtime Environment Variables** - Deploy the same build to different environments
9
+ - **Caching** - Avoid repeated AWS API calls during request handling
10
+ - **React Context** - Share configuration across your component tree
11
+ - **Type Safety** - Full TypeScript support with Zod schema validation
12
+ - **AWS Services** - Load configuration from Secrets Manager, SSM Parameter Store, S3
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @dyanet/nextjs-config-aws
18
+ ```
19
+
20
+ ### Peer Dependencies
21
+
22
+ ```bash
23
+ npm install next react
24
+ ```
25
+
26
+ For AWS services, install the SDK clients you need:
27
+
28
+ ```bash
29
+ # For Secrets Manager
30
+ npm install @aws-sdk/client-secrets-manager
31
+
32
+ # For SSM Parameter Store
33
+ npm install @aws-sdk/client-ssm
34
+
35
+ # For S3
36
+ npm install @aws-sdk/client-s3
37
+
38
+ # For schema validation
39
+ npm install zod
40
+ ```
41
+
42
+ ## Quick Start
43
+
44
+ ### Server-Side Configuration
45
+
46
+ ```typescript
47
+ // app/page.tsx (Server Component)
48
+ import { getConfig, EnvironmentLoader, SecretsManagerLoader } from '@dyanet/nextjs-config-aws';
49
+ import { z } from 'zod';
50
+
51
+ const schema = z.object({
52
+ DATABASE_URL: z.string(),
53
+ API_KEY: z.string(),
54
+ });
55
+
56
+ export default async function Page() {
57
+ const config = await getConfig({
58
+ schema,
59
+ loaders: [
60
+ new EnvironmentLoader(),
61
+ new SecretsManagerLoader({ secretName: '/my-app/config' }),
62
+ ],
63
+ precedence: 'aws-first',
64
+ });
65
+
66
+ return <div>Connected to: {config.DATABASE_URL}</div>;
67
+ }
68
+ ```
69
+
70
+ ### Runtime Environment Variables
71
+
72
+ ```tsx
73
+ // app/layout.tsx
74
+ import { PublicEnvScript } from '@dyanet/nextjs-config-aws';
75
+
76
+ export default function RootLayout({ children }) {
77
+ return (
78
+ <html>
79
+ <head>
80
+ <PublicEnvScript
81
+ publicVars={['API_URL', 'APP_NAME', 'FEATURE_FLAGS']}
82
+ />
83
+ </head>
84
+ <body>{children}</body>
85
+ </html>
86
+ );
87
+ }
88
+ ```
89
+
90
+ ```tsx
91
+ // app/components/client-component.tsx
92
+ 'use client';
93
+
94
+ import { env } from '@dyanet/nextjs-config-aws';
95
+
96
+ export function ClientComponent() {
97
+ const apiUrl = env('API_URL');
98
+ const appName = env('APP_NAME', 'My App');
99
+
100
+ return <div>API: {apiUrl}, App: {appName}</div>;
101
+ }
102
+ ```
103
+
104
+ ## Server-Side API
105
+
106
+ ### getConfig()
107
+
108
+ Load configuration in Server Components, API routes, or server actions:
109
+
110
+ ```typescript
111
+ import { getConfig, EnvironmentLoader, SecretsManagerLoader } from '@dyanet/nextjs-config-aws';
112
+ import { z } from 'zod';
113
+
114
+ const schema = z.object({
115
+ DATABASE_URL: z.string(),
116
+ API_KEY: z.string(),
117
+ PORT: z.coerce.number().default(3000),
118
+ });
119
+
120
+ // In a Server Component
121
+ export default async function Page() {
122
+ const config = await getConfig({
123
+ schema,
124
+ loaders: [
125
+ new EnvironmentLoader({ prefix: 'APP_' }),
126
+ new SecretsManagerLoader({ secretName: '/my-app/secrets' }),
127
+ ],
128
+ precedence: 'aws-first',
129
+ cache: true, // Enable caching (default: true)
130
+ cacheTTL: 60000, // Cache for 1 minute (default)
131
+ });
132
+
133
+ return <div>{config.DATABASE_URL}</div>;
134
+ }
135
+ ```
136
+
137
+ #### Options
138
+
139
+ | Option | Type | Default | Description |
140
+ |--------|------|---------|-------------|
141
+ | `schema` | `ZodType<T>` | `undefined` | Zod schema for validation |
142
+ | `loaders` | `ConfigLoader[]` | `[]` | Array of configuration loaders |
143
+ | `precedence` | `PrecedenceStrategy` | `'aws-first'` | Precedence strategy |
144
+ | `cache` | `boolean` | `true` | Enable caching |
145
+ | `cacheTTL` | `number` | `60000` | Cache TTL in milliseconds |
146
+ | `enableLogging` | `boolean` | `false` | Enable logging |
147
+
148
+ ### Cache Management
149
+
150
+ ```typescript
151
+ import { clearConfigCache, getConfigCacheSize, invalidateConfig } from '@dyanet/nextjs-config-aws';
152
+
153
+ // Clear all cached configurations
154
+ clearConfigCache();
155
+
156
+ // Get number of cached configurations
157
+ const size = getConfigCacheSize();
158
+
159
+ // Invalidate a specific configuration
160
+ invalidateConfig({ loaders: [...], precedence: 'aws-first' });
161
+ ```
162
+
163
+ ### createConfigProvider()
164
+
165
+ Create a typed React context provider for sharing configuration:
166
+
167
+ ```typescript
168
+ // lib/config.ts
169
+ import { createConfigProvider, getConfig } from '@dyanet/nextjs-config-aws';
170
+ import { z } from 'zod';
171
+
172
+ const schema = z.object({
173
+ DATABASE_URL: z.string(),
174
+ API_KEY: z.string(),
175
+ });
176
+
177
+ export type AppConfig = z.infer<typeof schema>;
178
+
179
+ // Create typed provider and hook
180
+ export const { ConfigProvider, useConfig } = createConfigProvider<AppConfig>();
181
+ export { schema };
182
+ ```
183
+
184
+ ```tsx
185
+ // app/layout.tsx
186
+ import { ConfigProvider, schema } from '@/lib/config';
187
+ import { getConfig, EnvironmentLoader } from '@dyanet/nextjs-config-aws';
188
+
189
+ export default async function RootLayout({ children }) {
190
+ const config = await getConfig({
191
+ schema,
192
+ loaders: [new EnvironmentLoader()],
193
+ });
194
+
195
+ return (
196
+ <html>
197
+ <body>
198
+ <ConfigProvider config={config}>
199
+ {children}
200
+ </ConfigProvider>
201
+ </body>
202
+ </html>
203
+ );
204
+ }
205
+ ```
206
+
207
+ ```tsx
208
+ // app/components/my-component.tsx
209
+ 'use client';
210
+
211
+ import { useConfig } from '@/lib/config';
212
+
213
+ export function MyComponent() {
214
+ const config = useConfig();
215
+ return <div>API Key: {config.API_KEY}</div>;
216
+ }
217
+ ```
218
+
219
+ ## Runtime Environment Variables
220
+
221
+ ### PublicEnvScript
222
+
223
+ Server component that injects environment variables into the client:
224
+
225
+ ```tsx
226
+ import { PublicEnvScript } from '@dyanet/nextjs-config-aws';
227
+
228
+ // In your root layout
229
+ <PublicEnvScript
230
+ publicVars={['API_URL', 'APP_NAME']} // Explicit allowlist
231
+ variableName="__ENV" // Global variable name (default)
232
+ nonce={cspNonce} // CSP nonce (optional)
233
+ />
234
+
235
+ // Or use prefix filtering
236
+ <PublicEnvScript
237
+ publicPrefix="PUBLIC_" // Include all PUBLIC_* vars
238
+ />
239
+ ```
240
+
241
+ #### Props
242
+
243
+ | Prop | Type | Default | Description |
244
+ |------|------|---------|-------------|
245
+ | `publicVars` | `string[]` | `undefined` | Explicit list of variables to expose |
246
+ | `publicPrefix` | `string` | `undefined` | Prefix to filter variables |
247
+ | `variableName` | `string` | `'__ENV'` | Global variable name on window |
248
+ | `nonce` | `string` | `undefined` | CSP nonce for script tag |
249
+
250
+ **Security Note:** Only expose variables that are safe for public access. Never expose secrets, API keys, or sensitive data.
251
+
252
+ ### Client-Side Access
253
+
254
+ ```typescript
255
+ 'use client';
256
+
257
+ import { env, envFrom, getAllEnv, hasEnv } from '@dyanet/nextjs-config-aws';
258
+
259
+ // Get a variable (returns undefined if not found)
260
+ const apiUrl = env('API_URL');
261
+
262
+ // Get with default value
263
+ const appName = env('APP_NAME', 'My App');
264
+
265
+ // Get from custom variable name
266
+ const customVar = envFrom('__MY_ENV', 'API_URL');
267
+
268
+ // Get all variables
269
+ const allEnv = getAllEnv();
270
+
271
+ // Check if variable exists
272
+ if (hasEnv('FEATURE_FLAG')) {
273
+ // Feature is enabled
274
+ }
275
+ ```
276
+
277
+ ## App Router Examples
278
+
279
+ ### Server Component
280
+
281
+ ```tsx
282
+ // app/dashboard/page.tsx
283
+ import { getConfig, EnvironmentLoader, SSMParameterStoreLoader } from '@dyanet/nextjs-config-aws';
284
+ import { z } from 'zod';
285
+
286
+ const schema = z.object({
287
+ DATABASE_URL: z.string(),
288
+ FEATURE_FLAGS: z.string().transform(s => JSON.parse(s)),
289
+ });
290
+
291
+ export default async function DashboardPage() {
292
+ const config = await getConfig({
293
+ schema,
294
+ loaders: [
295
+ new EnvironmentLoader(),
296
+ new SSMParameterStoreLoader({ parameterPath: '/app/config' }),
297
+ ],
298
+ });
299
+
300
+ return (
301
+ <div>
302
+ <h1>Dashboard</h1>
303
+ <p>Features: {JSON.stringify(config.FEATURE_FLAGS)}</p>
304
+ </div>
305
+ );
306
+ }
307
+ ```
308
+
309
+ ### API Route
310
+
311
+ ```typescript
312
+ // app/api/config/route.ts
313
+ import { NextResponse } from 'next/server';
314
+ import { getConfig, EnvironmentLoader } from '@dyanet/nextjs-config-aws';
315
+ import { z } from 'zod';
316
+
317
+ const schema = z.object({
318
+ API_VERSION: z.string(),
319
+ MAX_REQUESTS: z.coerce.number(),
320
+ });
321
+
322
+ export async function GET() {
323
+ const config = await getConfig({
324
+ schema,
325
+ loaders: [new EnvironmentLoader()],
326
+ });
327
+
328
+ return NextResponse.json({
329
+ version: config.API_VERSION,
330
+ maxRequests: config.MAX_REQUESTS,
331
+ });
332
+ }
333
+ ```
334
+
335
+ ### Server Action
336
+
337
+ ```typescript
338
+ // app/actions.ts
339
+ 'use server';
340
+
341
+ import { getConfig, SecretsManagerLoader } from '@dyanet/nextjs-config-aws';
342
+ import { z } from 'zod';
343
+
344
+ const schema = z.object({
345
+ API_KEY: z.string(),
346
+ });
347
+
348
+ export async function fetchData() {
349
+ const config = await getConfig({
350
+ schema,
351
+ loaders: [new SecretsManagerLoader({ secretName: '/app/secrets' })],
352
+ });
353
+
354
+ const response = await fetch('https://api.example.com/data', {
355
+ headers: { 'Authorization': `Bearer ${config.API_KEY}` },
356
+ });
357
+
358
+ return response.json();
359
+ }
360
+ ```
361
+
362
+ ## Pages Router Examples
363
+
364
+ ### getServerSideProps
365
+
366
+ ```typescript
367
+ // pages/dashboard.tsx
368
+ import { getConfig, EnvironmentLoader } from '@dyanet/nextjs-config-aws';
369
+ import { z } from 'zod';
370
+ import type { GetServerSideProps } from 'next';
371
+
372
+ const schema = z.object({
373
+ API_URL: z.string(),
374
+ });
375
+
376
+ export const getServerSideProps: GetServerSideProps = async () => {
377
+ const config = await getConfig({
378
+ schema,
379
+ loaders: [new EnvironmentLoader()],
380
+ });
381
+
382
+ return {
383
+ props: {
384
+ apiUrl: config.API_URL,
385
+ },
386
+ };
387
+ };
388
+
389
+ export default function Dashboard({ apiUrl }: { apiUrl: string }) {
390
+ return <div>API URL: {apiUrl}</div>;
391
+ }
392
+ ```
393
+
394
+ ### API Route (Pages Router)
395
+
396
+ ```typescript
397
+ // pages/api/config.ts
398
+ import type { NextApiRequest, NextApiResponse } from 'next';
399
+ import { getConfig, EnvironmentLoader } from '@dyanet/nextjs-config-aws';
400
+ import { z } from 'zod';
401
+
402
+ const schema = z.object({
403
+ APP_VERSION: z.string(),
404
+ });
405
+
406
+ export default async function handler(req: NextApiRequest, res: NextApiResponse) {
407
+ const config = await getConfig({
408
+ schema,
409
+ loaders: [new EnvironmentLoader()],
410
+ });
411
+
412
+ res.json({ version: config.APP_VERSION });
413
+ }
414
+ ```
415
+
416
+ ## Re-exported Types
417
+
418
+ All types from `@dyanet/config-aws` are re-exported:
419
+
420
+ ```typescript
421
+ import {
422
+ // Loaders
423
+ EnvironmentLoader,
424
+ EnvFileLoader,
425
+ S3Loader,
426
+ SecretsManagerLoader,
427
+ SSMParameterStoreLoader,
428
+
429
+ // ConfigManager
430
+ ConfigManager,
431
+
432
+ // Error classes
433
+ ConfigurationError,
434
+ ValidationError,
435
+ AWSServiceError,
436
+ ConfigurationLoadError,
437
+ MissingConfigurationError,
438
+
439
+ // Utilities
440
+ ConfigValidationUtil,
441
+ EnvFileParser,
442
+
443
+ // Types
444
+ ConfigLoader,
445
+ ConfigManagerOptions,
446
+ LoaderPrecedence,
447
+ VerboseOptions,
448
+ } from '@dyanet/nextjs-config-aws';
449
+ ```
450
+
451
+ ## Related Packages
452
+
453
+ - **[@dyanet/config-aws](../config-aws)** - Framework-agnostic core library
454
+ - **[@dyanet/nestjs-config-aws](../nestjs-config-aws)** - NestJS adapter
455
+
456
+ ## License
457
+
458
+ MIT
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ /**
3
+ * Client-side environment variable access for Next.js applications.
4
+ *
5
+ * This module provides a function to read runtime environment variables
6
+ * that were injected by the PublicEnvScript server component.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * 'use client';
11
+ *
12
+ * import { env } from '@dyanet/nextjs-config-aws/client';
13
+ *
14
+ * function MyComponent() {
15
+ * const apiUrl = env('API_URL');
16
+ * const appName = env('APP_NAME', 'Default App');
17
+ *
18
+ * return <div>API: {apiUrl}, App: {appName}</div>;
19
+ * }
20
+ * ```
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.env = env;
24
+ exports.envFrom = envFrom;
25
+ exports.getAllEnv = getAllEnv;
26
+ exports.hasEnv = hasEnv;
27
+ /**
28
+ * Default variable name used by PublicEnvScript.
29
+ */
30
+ const DEFAULT_VARIABLE_NAME = '__ENV';
31
+ /**
32
+ * Gets the environment variables object from the window.
33
+ *
34
+ * @param variableName - The global variable name to read from
35
+ * @returns The environment variables object, or an empty object if not found
36
+ */
37
+ function getEnvObject(variableName = DEFAULT_VARIABLE_NAME) {
38
+ if (typeof window === 'undefined') {
39
+ // Server-side or during SSR - return empty object
40
+ return {};
41
+ }
42
+ const envObj = window[variableName];
43
+ if (envObj && typeof envObj === 'object' && !Array.isArray(envObj)) {
44
+ return envObj;
45
+ }
46
+ return {};
47
+ }
48
+ /**
49
+ * Implementation of the env function.
50
+ */
51
+ function env(key, defaultValue) {
52
+ const envObj = getEnvObject();
53
+ const value = envObj[key];
54
+ if (value !== undefined) {
55
+ return value;
56
+ }
57
+ return defaultValue;
58
+ }
59
+ /**
60
+ * Implementation of the envFrom function.
61
+ */
62
+ function envFrom(variableName, key, defaultValue) {
63
+ const envObj = getEnvObject(variableName);
64
+ const value = envObj[key];
65
+ if (value !== undefined) {
66
+ return value;
67
+ }
68
+ return defaultValue;
69
+ }
70
+ /**
71
+ * Gets all runtime environment variables.
72
+ *
73
+ * @param variableName - The global variable name to read from (default: '__ENV')
74
+ * @returns A copy of all environment variables
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const allEnv = getAllEnv();
79
+ * console.log(allEnv); // { API_URL: '...', APP_NAME: '...' }
80
+ * ```
81
+ */
82
+ function getAllEnv(variableName = DEFAULT_VARIABLE_NAME) {
83
+ return { ...getEnvObject(variableName) };
84
+ }
85
+ /**
86
+ * Checks if a runtime environment variable exists.
87
+ *
88
+ * @param key - The environment variable name
89
+ * @param variableName - The global variable name to read from (default: '__ENV')
90
+ * @returns True if the variable exists, false otherwise
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * if (hasEnv('FEATURE_FLAG')) {
95
+ * // Feature is enabled
96
+ * }
97
+ * ```
98
+ */
99
+ function hasEnv(key, variableName = DEFAULT_VARIABLE_NAME) {
100
+ const envObj = getEnvObject(variableName);
101
+ return key in envObj;
102
+ }
103
+ exports.default = env;
104
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../../src/client/env.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AA0EH,kBASC;AAgCD,0BASC;AAcD,8BAEC;AAgBD,wBAGC;AAnJD;;GAEG;AACH,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAEtC;;;;;GAKG;AACH,SAAS,YAAY,CAAC,eAAuB,qBAAqB;IAChE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,kDAAkD;QAClD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IACpC,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnE,OAAO,MAAgC,CAAC;IAC1C,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAoCD;;GAEG;AACH,SAAgB,GAAG,CAAI,GAAW,EAAE,YAAgB;IAClD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAE1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AA6BD;;GAEG;AACH,SAAgB,OAAO,CAAI,YAAoB,EAAE,GAAW,EAAE,YAAgB;IAC5E,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAE1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,SAAS,CAAC,eAAuB,qBAAqB;IACpE,OAAO,EAAE,GAAG,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,MAAM,CAAC,GAAW,EAAE,eAAuB,qBAAqB;IAC9E,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC1C,OAAO,GAAG,IAAI,MAAM,CAAC;AACvB,CAAC;AAED,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Client-side exports for Next.js configuration management.
4
+ *
5
+ * These utilities are designed for use in client components ('use client')
6
+ * to access runtime environment variables injected by PublicEnvScript.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.hasEnv = exports.getAllEnv = exports.envFrom = exports.env = void 0;
10
+ var env_1 = require("./env");
11
+ Object.defineProperty(exports, "env", { enumerable: true, get: function () { return env_1.env; } });
12
+ Object.defineProperty(exports, "envFrom", { enumerable: true, get: function () { return env_1.envFrom; } });
13
+ Object.defineProperty(exports, "getAllEnv", { enumerable: true, get: function () { return env_1.getAllEnv; } });
14
+ Object.defineProperty(exports, "hasEnv", { enumerable: true, get: function () { return env_1.hasEnv; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAwD;AAA/C,0FAAA,GAAG,OAAA;AAAE,8FAAA,OAAO,OAAA;AAAE,gGAAA,SAAS,OAAA;AAAE,6FAAA,MAAM,OAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Client-side components for Next.js configuration management.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generateScriptContent = exports.filterEnvVars = exports.PublicEnvScript = void 0;
7
+ var public_env_script_1 = require("./public-env-script");
8
+ Object.defineProperty(exports, "PublicEnvScript", { enumerable: true, get: function () { return public_env_script_1.PublicEnvScript; } });
9
+ Object.defineProperty(exports, "filterEnvVars", { enumerable: true, get: function () { return public_env_script_1.filterEnvVars; } });
10
+ Object.defineProperty(exports, "generateScriptContent", { enumerable: true, get: function () { return public_env_script_1.generateScriptContent; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yDAK6B;AAJ3B,oHAAA,eAAe,OAAA;AACf,kHAAA,aAAa,OAAA;AACb,0HAAA,qBAAqB,OAAA"}