@funnelsgrove/runtime 0.1.11 → 0.1.13
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.
|
@@ -10,7 +10,7 @@ import { usePreviewBridge } from './preview-bridge.js';
|
|
|
10
10
|
import { resolveExperimentAssignment } from './experiment-assignment.js';
|
|
11
11
|
import { collectCurrentFunnelAttribution } from './funnel-attribution.js';
|
|
12
12
|
import { resolveUrlUserAttributes } from './url-user-attributes.js';
|
|
13
|
-
import { bootstrapPostHog,
|
|
13
|
+
import { bootstrapPostHog, identifyPostHog, isPostHogReady, resolveExperimentVariant, } from './posthog-flags.js';
|
|
14
14
|
import { isEditorEnabled, useRuntimeMode } from '../services/runtime-mode.service.js';
|
|
15
15
|
import { isPreviewFrameRuntime } from '../services/preview-frame.service.js';
|
|
16
16
|
const FIRST_STEP_ENGAGEMENT_THRESHOLD_MS = 1000;
|
|
@@ -18,9 +18,6 @@ const buildFeatureFlagProperties = (featureFlags) => {
|
|
|
18
18
|
return Object.fromEntries(Object.entries(featureFlags).map(([key, value]) => [`$feature/${key}`, value]));
|
|
19
19
|
};
|
|
20
20
|
const capturePostHogStepEvent = (event, properties) => {
|
|
21
|
-
if (!getPostHog() || !POSTHOG_API_HOST || !POSTHOG_PROJECT_API_KEY || !PROJECT_ID) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
21
|
const payload = JSON.stringify({
|
|
25
22
|
api_key: POSTHOG_PROJECT_API_KEY,
|
|
26
23
|
batch: [
|
|
@@ -86,35 +86,8 @@ export const RUNTIME_PUBLIC_DEFAULTS = {
|
|
|
86
86
|
supportEmail: DEFAULT_SUPPORT_EMAIL,
|
|
87
87
|
timezone: DEFAULT_TIMEZONE,
|
|
88
88
|
};
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey,
|
|
92
|
-
PROJECT_ENV_STANDARD_KEYS.funnelId,
|
|
93
|
-
PROJECT_ENV_STANDARD_KEYS.funnelVersionId,
|
|
94
|
-
PROJECT_ENV_STANDARD_KEYS.projectId,
|
|
95
|
-
PROJECT_ENV_STANDARD_KEYS.posthogProjectApiKey,
|
|
96
|
-
PROJECT_ENV_STANDARD_KEYS.funnelSupportEmail,
|
|
97
|
-
'NEXT_PUBLIC_IOS_APP_STORE_URL',
|
|
98
|
-
PROJECT_ENV_STANDARD_KEYS.funnelAndroidPlayStoreUrl,
|
|
99
|
-
PROJECT_ENV_STANDARD_KEYS.funnelAppStoreId,
|
|
100
|
-
PROJECT_ENV_STANDARD_KEYS.funnelGoogleStoreId,
|
|
101
|
-
PROJECT_ENV_STANDARD_KEYS.funnelTimezone,
|
|
102
|
-
PROJECT_ENV_STANDARD_KEYS.funnelFaviconUrl,
|
|
103
|
-
PROJECT_ENV_STANDARD_KEYS.funnelPageTitle,
|
|
104
|
-
PROJECT_ENV_STANDARD_KEYS.funnelPageDescription,
|
|
105
|
-
PROJECT_ENV_STANDARD_KEYS.funnelPagePreviewImageUrl,
|
|
106
|
-
PROJECT_ENV_STANDARD_KEYS.funnelCompanyName,
|
|
107
|
-
PROJECT_ENV_STANDARD_KEYS.funnelCompanyAddress,
|
|
108
|
-
PROJECT_ENV_STANDARD_KEYS.funnelCompanyCountry,
|
|
109
|
-
PROJECT_ENV_STANDARD_KEYS.funnelPrivacyUrl,
|
|
110
|
-
PROJECT_ENV_STANDARD_KEYS.funnelTermsUrl,
|
|
111
|
-
PROJECT_ENV_STANDARD_KEYS.funnelUniversalLink,
|
|
112
|
-
PROJECT_ENV_STANDARD_KEYS.funnelIosDeepLink,
|
|
113
|
-
'NEXT_PUBLIC_FUNNEL_ANDROID_DEEP_LINK',
|
|
114
|
-
'NEXT_PUBLIC_FUNNEL_QR_TARGET',
|
|
115
|
-
PROJECT_ENV_STANDARD_KEYS.metaPixelEnabled,
|
|
116
|
-
PROJECT_ENV_STANDARD_KEYS.metaPixelId,
|
|
117
|
-
];
|
|
89
|
+
const isBrowserRuntimeEnvKey = (key) => key.startsWith('NEXT_PUBLIC_');
|
|
90
|
+
const NEXT_STATIC_EXPORT_RUNTIME_PUBLIC_KEYS = Array.from(new Set(Object.values(RUNTIME_ENV_KEYS).filter(isBrowserRuntimeEnvKey)));
|
|
118
91
|
const readNonEmptyStaticExportEnv = (env, key) => {
|
|
119
92
|
var _a;
|
|
120
93
|
return ((_a = env[key]) === null || _a === void 0 ? void 0 : _a.trim()) || null;
|