@funnelsgrove/runtime 0.1.8 → 0.1.10
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.
|
@@ -2,8 +2,8 @@ export declare const readRuntimeEnv: (reader: () => string | undefined) => strin
|
|
|
2
2
|
export declare const isDevelopmentRuntime: () => boolean;
|
|
3
3
|
export declare const RUNTIME_ENV_KEYS: {
|
|
4
4
|
readonly appDealsApiBaseUrl: readonly ["NEXT_PUBLIC_APP_DEALS_API_BASE_URL", "APP_DEALS_API_BASE_URL"];
|
|
5
|
-
readonly funnelSdkPublishableKey: readonly ["NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY", "
|
|
6
|
-
readonly funnelId: readonly ["NEXT_PUBLIC_FUNNEL_ID", "FUNNEL_ID", "NEXT_PUBLIC_RAG_FUNNEL_ID"
|
|
5
|
+
readonly funnelSdkPublishableKey: readonly ["NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY", "FUNNEL_SDK_PUBLISHABLE_KEY"];
|
|
6
|
+
readonly funnelId: readonly ["NEXT_PUBLIC_FUNNEL_ID", "FUNNEL_ID", "NEXT_PUBLIC_RAG_FUNNEL_ID"];
|
|
7
7
|
readonly projectId: readonly ["NEXT_PUBLIC_PROJECT_ID", "PROJECT_ID"];
|
|
8
8
|
readonly funnelVersionId: readonly ["NEXT_PUBLIC_FUNNEL_VERSION_ID", "FUNNEL_VERSION_ID"];
|
|
9
9
|
readonly posthogProjectApiKey: readonly ["NEXT_PUBLIC_POSTHOG_PROJECT_API_KEY", "POSTHOG_PROJECT_API_KEY"];
|
|
@@ -15,16 +15,12 @@ export const RUNTIME_ENV_KEYS = {
|
|
|
15
15
|
appDealsApiBaseUrl: ['NEXT_PUBLIC_APP_DEALS_API_BASE_URL', 'APP_DEALS_API_BASE_URL'],
|
|
16
16
|
funnelSdkPublishableKey: [
|
|
17
17
|
'NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY',
|
|
18
|
-
'NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY',
|
|
19
18
|
'FUNNEL_SDK_PUBLISHABLE_KEY',
|
|
20
19
|
],
|
|
21
20
|
funnelId: [
|
|
22
21
|
'NEXT_PUBLIC_FUNNEL_ID',
|
|
23
22
|
'FUNNEL_ID',
|
|
24
23
|
'NEXT_PUBLIC_RAG_FUNNEL_ID',
|
|
25
|
-
'RAG_FUNNEL_ID',
|
|
26
|
-
'NEXT_PUBLIC_PREVIEW_TEST_FUNNEL_ID',
|
|
27
|
-
'PREVIEW_TEST_FUNNEL_ID',
|
|
28
24
|
],
|
|
29
25
|
projectId: ['NEXT_PUBLIC_PROJECT_ID', 'PROJECT_ID'],
|
|
30
26
|
funnelVersionId: ['NEXT_PUBLIC_FUNNEL_VERSION_ID', 'FUNNEL_VERSION_ID'],
|
|
@@ -114,10 +110,7 @@ const RUNTIME_ENV_VALUES = {
|
|
|
114
110
|
CLAIMBEE_WEEKLY_PRICE_ID: readRuntimeEnv(() => process.env.CLAIMBEE_WEEKLY_PRICE_ID),
|
|
115
111
|
CLAIMBEE_MONTHLY_PRICE_ID: readRuntimeEnv(() => process.env.CLAIMBEE_MONTHLY_PRICE_ID),
|
|
116
112
|
CLAIMBEE_YEARLY_PRICE_ID: readRuntimeEnv(() => process.env.CLAIMBEE_YEARLY_PRICE_ID),
|
|
117
|
-
RAG_FUNNEL_ID: readRuntimeEnv(() => process.env.RAG_FUNNEL_ID),
|
|
118
|
-
PREVIEW_TEST_FUNNEL_ID: readRuntimeEnv(() => process.env.PREVIEW_TEST_FUNNEL_ID),
|
|
119
113
|
NEXT_PUBLIC_APP_DEALS_API_BASE_URL: readRuntimeEnv(() => process.env.NEXT_PUBLIC_APP_DEALS_API_BASE_URL),
|
|
120
|
-
NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY),
|
|
121
114
|
NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY),
|
|
122
115
|
NEXT_PUBLIC_FUNNEL_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_ID),
|
|
123
116
|
NEXT_PUBLIC_FUNNEL_VERSION_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_VERSION_ID),
|
|
@@ -143,7 +136,6 @@ const RUNTIME_ENV_VALUES = {
|
|
|
143
136
|
NEXT_PUBLIC_FUNNEL_ANDROID_DEEP_LINK: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_ANDROID_DEEP_LINK),
|
|
144
137
|
NEXT_PUBLIC_FUNNEL_QR_TARGET: readRuntimeEnv(() => process.env.NEXT_PUBLIC_FUNNEL_QR_TARGET),
|
|
145
138
|
NEXT_PUBLIC_RAG_FUNNEL_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_RAG_FUNNEL_ID),
|
|
146
|
-
NEXT_PUBLIC_PREVIEW_TEST_FUNNEL_ID: readRuntimeEnv(() => process.env.NEXT_PUBLIC_PREVIEW_TEST_FUNNEL_ID),
|
|
147
139
|
NEXT_PUBLIC_STRIPE_ACTIVE_MODE: readRuntimeEnv(() => process.env.NEXT_PUBLIC_STRIPE_ACTIVE_MODE),
|
|
148
140
|
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY),
|
|
149
141
|
NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY: readRuntimeEnv(() => process.env.NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY),
|
|
@@ -2,8 +2,8 @@ import { isDevelopmentRuntime, readRuntimeEnv } from '../config/env.config.js';
|
|
|
2
2
|
export { isDevelopmentRuntime, readRuntimeEnv };
|
|
3
3
|
export declare const RUNTIME_PUBLIC_ENV_KEYS: {
|
|
4
4
|
readonly apiBaseUrl: readonly ["NEXT_PUBLIC_APP_DEALS_API_BASE_URL", "APP_DEALS_API_BASE_URL"];
|
|
5
|
-
readonly funnelSdkPublishableKey: readonly ["NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY", "
|
|
6
|
-
readonly funnelId: readonly ["NEXT_PUBLIC_FUNNEL_ID", "FUNNEL_ID", "NEXT_PUBLIC_RAG_FUNNEL_ID"
|
|
5
|
+
readonly funnelSdkPublishableKey: readonly ["NEXT_PUBLIC_FUNNEL_PUBLISHABLE_KEY", "FUNNEL_SDK_PUBLISHABLE_KEY"];
|
|
6
|
+
readonly funnelId: readonly ["NEXT_PUBLIC_FUNNEL_ID", "FUNNEL_ID", "NEXT_PUBLIC_RAG_FUNNEL_ID"];
|
|
7
7
|
readonly funnelVersionId: readonly ["NEXT_PUBLIC_FUNNEL_VERSION_ID", "FUNNEL_VERSION_ID"];
|
|
8
8
|
readonly projectId: readonly ["NEXT_PUBLIC_PROJECT_ID", "PROJECT_ID"];
|
|
9
9
|
readonly posthogProjectApiKey: readonly ["NEXT_PUBLIC_POSTHOG_PROJECT_API_KEY", "POSTHOG_PROJECT_API_KEY"];
|
|
@@ -61,9 +61,6 @@ export declare const RUNTIME_PUBLIC_DEFAULTS: {
|
|
|
61
61
|
readonly supportEmail: "support@example.com";
|
|
62
62
|
readonly timezone: "UTC";
|
|
63
63
|
};
|
|
64
|
-
export declare const RUNTIME_PREVIEW_PAYMENT_DEFAULTS: {
|
|
65
|
-
readonly funnelSdkPublishableKey: "pk_test_51SopXWPEfkEVo5kh6foOs9zVyKsVSKLhlQw8YsAfMMymRlGH3Qp8U5I7j5bHivmOB232oJiQZi8cEv1wkmV80QGg00vPcI1DZI";
|
|
66
|
-
};
|
|
67
64
|
export type RuntimeStaticExportEnv = Record<string, string | undefined>;
|
|
68
65
|
export declare const resolveNextStaticExportRuntimeEnv: (env: RuntimeStaticExportEnv) => Record<string, string>;
|
|
69
66
|
export declare const isSeedFunnelSdkPublishableKey: (value: string | null | undefined) => boolean;
|
|
@@ -5,7 +5,6 @@ const DEFAULT_API_BASE_URL = 'https://sdk-api.funnelsgrove.com';
|
|
|
5
5
|
const DEFAULT_FUNNEL_SDK_PUBLISHABLE_KEY = 'pk_test_app_deals_seed_public';
|
|
6
6
|
const DEFAULT_SUPPORT_EMAIL = 'support@example.com';
|
|
7
7
|
const DEFAULT_TIMEZONE = 'UTC';
|
|
8
|
-
const DEFAULT_PREVIEW_PAYMENT_PUBLISHABLE_KEY = 'pk_test_51SopXWPEfkEVo5kh6foOs9zVyKsVSKLhlQw8YsAfMMymRlGH3Qp8U5I7j5bHivmOB232oJiQZi8cEv1wkmV80QGg00vPcI1DZI';
|
|
9
8
|
const trimTrailingSlash = (value) => {
|
|
10
9
|
return value.replace(/\/+$/, '');
|
|
11
10
|
};
|
|
@@ -87,9 +86,6 @@ export const RUNTIME_PUBLIC_DEFAULTS = {
|
|
|
87
86
|
supportEmail: DEFAULT_SUPPORT_EMAIL,
|
|
88
87
|
timezone: DEFAULT_TIMEZONE,
|
|
89
88
|
};
|
|
90
|
-
export const RUNTIME_PREVIEW_PAYMENT_DEFAULTS = {
|
|
91
|
-
funnelSdkPublishableKey: DEFAULT_PREVIEW_PAYMENT_PUBLISHABLE_KEY,
|
|
92
|
-
};
|
|
93
89
|
const NEXT_STATIC_EXPORT_RUNTIME_PUBLIC_KEYS = [
|
|
94
90
|
{
|
|
95
91
|
outputKey: 'NEXT_PUBLIC_APP_DEALS_API_BASE_URL',
|
|
@@ -97,10 +93,7 @@ const NEXT_STATIC_EXPORT_RUNTIME_PUBLIC_KEYS = [
|
|
|
97
93
|
},
|
|
98
94
|
{
|
|
99
95
|
outputKey: PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey,
|
|
100
|
-
inputKeys: [
|
|
101
|
-
PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey,
|
|
102
|
-
'NEXT_PUBLIC_FUNNEL_SDK_PUBLISHABLE_KEY',
|
|
103
|
-
],
|
|
96
|
+
inputKeys: [PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey],
|
|
104
97
|
},
|
|
105
98
|
{ outputKey: PROJECT_ENV_STANDARD_KEYS.funnelId, inputKeys: [PROJECT_ENV_STANDARD_KEYS.funnelId] },
|
|
106
99
|
{ outputKey: PROJECT_ENV_STANDARD_KEYS.funnelVersionId, inputKeys: [PROJECT_ENV_STANDARD_KEYS.funnelVersionId] },
|
|
@@ -170,22 +163,23 @@ export const resolveNextStaticExportRuntimeEnv = (env) => {
|
|
|
170
163
|
return value ? [[outputKey, value]] : [];
|
|
171
164
|
}));
|
|
172
165
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
166
|
+
const publishableKey = readNonEmptyStaticExportEnv(env, [
|
|
167
|
+
PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey,
|
|
168
|
+
]);
|
|
169
|
+
return Object.assign(Object.assign({}, (publishableKey ? { [PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey]: publishableKey } : {})), { [PROJECT_ENV_STANDARD_KEYS.funnelId]: ((_b = env.NEXT_PUBLIC_RAG_FUNNEL_ID) === null || _b === void 0 ? void 0 : _b.trim()) || '' });
|
|
177
170
|
};
|
|
178
171
|
export const isSeedFunnelSdkPublishableKey = (value) => {
|
|
179
172
|
const normalized = (value === null || value === void 0 ? void 0 : value.trim()) || '';
|
|
180
173
|
return !normalized || normalized === DEFAULT_FUNNEL_SDK_PUBLISHABLE_KEY;
|
|
181
174
|
};
|
|
182
175
|
export const isPreviewPaymentPublishableKey = (value) => {
|
|
183
|
-
|
|
176
|
+
void value;
|
|
177
|
+
return false;
|
|
184
178
|
};
|
|
185
179
|
export const resolvePreviewPaymentPublishableKey = (value) => {
|
|
186
180
|
const normalized = (value === null || value === void 0 ? void 0 : value.trim()) || '';
|
|
187
181
|
if (isSeedFunnelSdkPublishableKey(normalized)) {
|
|
188
|
-
return
|
|
182
|
+
return '';
|
|
189
183
|
}
|
|
190
184
|
return normalized;
|
|
191
185
|
};
|