@founderhq/journeys 0.8.1 → 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/dist/_tsup-dts-rollup.d.cts +156 -1
- package/dist/_tsup-dts-rollup.d.ts +156 -1
- package/dist/index.cjs +337 -44
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +330 -45
- package/package.json +1 -1
|
@@ -970,6 +970,22 @@ export { evaluateCondition as evaluateCondition_alias_1 }
|
|
|
970
970
|
|
|
971
971
|
export declare function evaluateSafeExpression(expression: string, scope: Scope): unknown;
|
|
972
972
|
|
|
973
|
+
/** `fhq_consent_<fingerprint>` — the cookie the events SDK remembers consent in. */
|
|
974
|
+
export declare function eventsConsentCookieName(apiKey: string): string;
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* `fhq_id_<key without punctuation, first 16 characters>` — the identity
|
|
978
|
+
* cookie the events SDK shares across subdomains. On init the SDK lets it
|
|
979
|
+
* win over this origin's stored copy, so a visitor identified on `www` is
|
|
980
|
+
* the same person on `app`; the journey reads it for the same reason.
|
|
981
|
+
*/
|
|
982
|
+
export declare function eventsIdentityCookieName(apiKey: string): string;
|
|
983
|
+
|
|
984
|
+
/** `founderhq:events:v2:<first 16 characters of the key>` — the events SDK's key. */
|
|
985
|
+
declare function eventsStorageKey(apiKey: string): string;
|
|
986
|
+
export { eventsStorageKey }
|
|
987
|
+
export { eventsStorageKey as eventsStorageKey_alias_1 }
|
|
988
|
+
|
|
973
989
|
declare type ExitAnimationPreset = "fade-out" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "scale-down" | "blur-out" | "none";
|
|
974
990
|
export { ExitAnimationPreset }
|
|
975
991
|
export { ExitAnimationPreset as ExitAnimationPreset_alias_1 }
|
|
@@ -1013,6 +1029,14 @@ declare type FetchState = {
|
|
|
1013
1029
|
export { FetchState }
|
|
1014
1030
|
export { FetchState as FetchState_alias_1 }
|
|
1015
1031
|
|
|
1032
|
+
/** The hosted events snippet publishes its client as `globalThis.founderhq`. */
|
|
1033
|
+
export declare function findGlobalEventsClient(): JourneyEventsClient | null;
|
|
1034
|
+
|
|
1035
|
+
/** The first family of a CSS font stack, without quotes. */
|
|
1036
|
+
declare function firstFontFamily(stack: string | undefined): string | undefined;
|
|
1037
|
+
export { firstFontFamily }
|
|
1038
|
+
export { firstFontFamily as firstFontFamily_alias_1 }
|
|
1039
|
+
|
|
1016
1040
|
export declare function FloatingLabelBlock({ text, variant, color, gradient, className, }: FloatingLabelBlockProps): JSX.Element;
|
|
1017
1041
|
|
|
1018
1042
|
declare type FloatingLabelBlockProps = {
|
|
@@ -1030,6 +1054,14 @@ export declare const FOUNDERHQ_BASE_URL = "https://app.getfounderhq.com";
|
|
|
1030
1054
|
|
|
1031
1055
|
export declare function getGravityBinShape(id: string): GravityBinShape;
|
|
1032
1056
|
|
|
1057
|
+
/**
|
|
1058
|
+
* The web fonts a journey uses: the font of the whole journey, and the font
|
|
1059
|
+
* of any block or text segment that sets its own. Sorted, without repeats.
|
|
1060
|
+
*/
|
|
1061
|
+
declare function getJourneyWebFontFamilies(config: JourneyConfig): string[];
|
|
1062
|
+
export { getJourneyWebFontFamilies }
|
|
1063
|
+
export { getJourneyWebFontFamilies as getJourneyWebFontFamilies_alias_1 }
|
|
1064
|
+
|
|
1033
1065
|
declare function getScreenNameError(value: string): string | null;
|
|
1034
1066
|
export { getScreenNameError }
|
|
1035
1067
|
export { getScreenNameError as getScreenNameError_alias_1 }
|
|
@@ -1061,6 +1093,17 @@ export { getVariableNameError }
|
|
|
1061
1093
|
export { getVariableNameError as getVariableNameError_alias_1 }
|
|
1062
1094
|
export { getVariableNameError as getVariableNameError_alias_2 }
|
|
1063
1095
|
|
|
1096
|
+
/**
|
|
1097
|
+
* The stylesheet of a web font. Bunny Fonts carries the Google Fonts
|
|
1098
|
+
* catalog under the same names and does not track the visitor, so a
|
|
1099
|
+
* journey can use those fonts without a call to Google. A weight the
|
|
1100
|
+
* family does not have is left out of the answer, and an unknown name
|
|
1101
|
+
* gives an empty stylesheet, so the request never fails the page.
|
|
1102
|
+
*/
|
|
1103
|
+
declare function getWebFontStylesheetUrl(family: string): string;
|
|
1104
|
+
export { getWebFontStylesheetUrl }
|
|
1105
|
+
export { getWebFontStylesheetUrl as getWebFontStylesheetUrl_alias_1 }
|
|
1106
|
+
|
|
1064
1107
|
declare type GradientValue = string | {
|
|
1065
1108
|
from: string;
|
|
1066
1109
|
to: string;
|
|
@@ -1210,6 +1253,11 @@ export { isValidVariableName }
|
|
|
1210
1253
|
export { isValidVariableName as isValidVariableName_alias_1 }
|
|
1211
1254
|
export { isValidVariableName as isValidVariableName_alias_2 }
|
|
1212
1255
|
|
|
1256
|
+
/** If this family is one a journey must load from the web to show it. */
|
|
1257
|
+
declare function isWebFontFamily(family: string | undefined): family is string;
|
|
1258
|
+
export { isWebFontFamily }
|
|
1259
|
+
export { isWebFontFamily as isWebFontFamily_alias_1 }
|
|
1260
|
+
|
|
1213
1261
|
declare type ItemRecord = Record<string, unknown>;
|
|
1214
1262
|
|
|
1215
1263
|
declare function Journey({ apiKey, journeyId, config, baseUrl, storageKey, onEvent, onOpenURL, className, presentation, theme, initialAnswers, initialOptions, onDiscountCodeApply, loadingComponent, errorComponent, capture, identity, }: JourneyProps): JSX.Element;
|
|
@@ -1267,6 +1315,17 @@ declare type JourneyCaptureConfig = JourneyCaptureOptions & {
|
|
|
1267
1315
|
baseUrl: string;
|
|
1268
1316
|
};
|
|
1269
1317
|
|
|
1318
|
+
declare type JourneyCaptureIdentity = {
|
|
1319
|
+
anonymousId?: string;
|
|
1320
|
+
distinctId?: string;
|
|
1321
|
+
/** The analytics session id, known only when an events client is present. */
|
|
1322
|
+
sessionId?: string;
|
|
1323
|
+
/** Where the ids came from; "none" means the visit is cookieless. */
|
|
1324
|
+
source: "events" | "storage" | "none";
|
|
1325
|
+
};
|
|
1326
|
+
export { JourneyCaptureIdentity }
|
|
1327
|
+
export { JourneyCaptureIdentity as JourneyCaptureIdentity_alias_1 }
|
|
1328
|
+
|
|
1270
1329
|
declare type JourneyCaptureOption = false | JourneyCaptureConfig;
|
|
1271
1330
|
export { JourneyCaptureOption }
|
|
1272
1331
|
export { JourneyCaptureOption as JourneyCaptureOption_alias_1 }
|
|
@@ -1287,6 +1346,21 @@ declare type JourneyCaptureOptions = {
|
|
|
1287
1346
|
* bearer credentials and network policy outside the hosted renderer.
|
|
1288
1347
|
*/
|
|
1289
1348
|
transport?: JourneyCaptureTransport;
|
|
1349
|
+
/**
|
|
1350
|
+
* The `@founderhq/events` client whose visitor identity this journey
|
|
1351
|
+
* shares. Left out, the hosted snippet's `globalThis.founderhq` is used
|
|
1352
|
+
* when present. `false` never looks at the page global.
|
|
1353
|
+
*/
|
|
1354
|
+
eventsClient?: JourneyEventsClient | false;
|
|
1355
|
+
/**
|
|
1356
|
+
* Whether a visitor gets a durable anonymous id when no events client is
|
|
1357
|
+
* on the page and no consent choice has been remembered. Defaults to
|
|
1358
|
+
* "granted": a journey response has no cookieless join, so without an id
|
|
1359
|
+
* it belongs to nobody. Pass "denied" while a consent banner is
|
|
1360
|
+
* unanswered, or run `@founderhq/events`, whose consent state the journey
|
|
1361
|
+
* then follows exactly.
|
|
1362
|
+
*/
|
|
1363
|
+
consentDefault?: JourneyEventsConsent;
|
|
1290
1364
|
};
|
|
1291
1365
|
export { JourneyCaptureOptions }
|
|
1292
1366
|
export { JourneyCaptureOptions as JourneyCaptureOptions_alias_1 }
|
|
@@ -1408,6 +1482,52 @@ export { JourneyEventComputedVariables }
|
|
|
1408
1482
|
export { JourneyEventComputedVariables as JourneyEventComputedVariables_alias_1 }
|
|
1409
1483
|
export { JourneyEventComputedVariables as JourneyEventComputedVariables_alias_2 }
|
|
1410
1484
|
|
|
1485
|
+
/**
|
|
1486
|
+
* How a journey learns who the visitor is.
|
|
1487
|
+
*
|
|
1488
|
+
* Rule: whoever loads first mints the anonymous id; the other adopts it.
|
|
1489
|
+
*
|
|
1490
|
+
* 1. An events client is on the page (`@founderhq/events`, passed in by the
|
|
1491
|
+
* host or found at `globalThis.founderhq` from the hosted snippet) and
|
|
1492
|
+
* hands out ids: its distinct id, anonymous id and session id are read at
|
|
1493
|
+
* every capture, so an `identify()` after the journey opened re-labels the
|
|
1494
|
+
* next event. Nothing is minted beside it.
|
|
1495
|
+
* 2. An events client is on the page and hands out no id. Either it runs
|
|
1496
|
+
* cookieless because consent is pending or denied, or the snippet has not
|
|
1497
|
+
* called `init()` yet. Its silence is the consent signal: the journey
|
|
1498
|
+
* writes nothing, and only adopts the state the events SDK left in storage
|
|
1499
|
+
* on an earlier, consented visit. Once the client starts handing out ids,
|
|
1500
|
+
* the next capture carries them.
|
|
1501
|
+
* 3. No events client (none on the page, or one that throws when asked): the
|
|
1502
|
+
* journey mints the anonymous id in the events SDK's own storage shape and
|
|
1503
|
+
* key, so an events client that initialises later on this site finds the
|
|
1504
|
+
* state and adopts the id, exactly as it adopts its own from a previous
|
|
1505
|
+
* visit. A remembered denial or opt-out, or `consentDefault: "denied"`
|
|
1506
|
+
* from the host, stops the mint: then the session carries only its
|
|
1507
|
+
* per-tab client session id.
|
|
1508
|
+
*
|
|
1509
|
+
* The storage key, state shape, identity cookie, and consent cookie below
|
|
1510
|
+
* mirror `packages/events/src/index.ts` (`PersistedState`, `init()`,
|
|
1511
|
+
* `readIdentityCookie`, and `readConsentPreference`). This package is not
|
|
1512
|
+
* in the pnpm workspace, so it cannot import them; `events-identity.test.ts`
|
|
1513
|
+
* pins every literal.
|
|
1514
|
+
*/
|
|
1515
|
+
declare type JourneyEventsClient = {
|
|
1516
|
+
/** The visitor's distinct id, or null while capture is not granted. */
|
|
1517
|
+
getDistinctId(): string | null;
|
|
1518
|
+
/** The anonymous and session ids, or an empty object while not granted. */
|
|
1519
|
+
checkoutMetadata(): {
|
|
1520
|
+
fhq_anonymous_id?: string;
|
|
1521
|
+
fhq_session_id?: string;
|
|
1522
|
+
};
|
|
1523
|
+
};
|
|
1524
|
+
export { JourneyEventsClient }
|
|
1525
|
+
export { JourneyEventsClient as JourneyEventsClient_alias_1 }
|
|
1526
|
+
|
|
1527
|
+
declare type JourneyEventsConsent = "granted" | "denied";
|
|
1528
|
+
export { JourneyEventsConsent }
|
|
1529
|
+
export { JourneyEventsConsent as JourneyEventsConsent_alias_1 }
|
|
1530
|
+
|
|
1411
1531
|
declare const JourneyHapticContext: Context<JourneyHapticHandler | null>;
|
|
1412
1532
|
export { JourneyHapticContext }
|
|
1413
1533
|
export { JourneyHapticContext as JourneyHapticContext_alias_1 }
|
|
@@ -1428,6 +1548,20 @@ declare type JourneyIdentity = {
|
|
|
1428
1548
|
export { JourneyIdentity }
|
|
1429
1549
|
export { JourneyIdentity as JourneyIdentity_alias_1 }
|
|
1430
1550
|
|
|
1551
|
+
export declare type JourneyIdentityOptions = {
|
|
1552
|
+
apiKey: string;
|
|
1553
|
+
/** `false` never consults `globalThis.founderhq`. */
|
|
1554
|
+
eventsClient?: JourneyEventsClient | false;
|
|
1555
|
+
/**
|
|
1556
|
+
* Applies only with no events client and no remembered consent choice.
|
|
1557
|
+
* Defaults to "granted": a journey response has no cookieless join, so
|
|
1558
|
+
* without an id it belongs to nobody. Pass "denied" while a consent banner
|
|
1559
|
+
* is unanswered, or run `@founderhq/events`, whose consent state the
|
|
1560
|
+
* journey then follows exactly.
|
|
1561
|
+
*/
|
|
1562
|
+
consentDefault?: JourneyEventsConsent;
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1431
1565
|
declare type JourneyOptionOverrides = Record<string, StepOption[]>;
|
|
1432
1566
|
export { JourneyOptionOverrides }
|
|
1433
1567
|
export { JourneyOptionOverrides as JourneyOptionOverrides_alias_1 }
|
|
@@ -2006,6 +2140,8 @@ export declare function RadioGroup({ className, ...props }: React_2.ComponentPro
|
|
|
2006
2140
|
|
|
2007
2141
|
export declare function RadioGroupItem({ className, ...props }: React_2.ComponentProps<typeof RadioGroup_2.Item>): React_2.JSX.Element;
|
|
2008
2142
|
|
|
2143
|
+
export declare function readEventsConsent(apiKey: string): "granted" | "denied" | "off" | null;
|
|
2144
|
+
|
|
2009
2145
|
/** Rewrites typed answer-key references without touching ordinary display copy. */
|
|
2010
2146
|
declare function renameAnswerVariableReferences<T>(value: T, renames: ReadonlyMap<string, string>): T;
|
|
2011
2147
|
export { renameAnswerVariableReferences }
|
|
@@ -2021,6 +2157,9 @@ export declare function renderExpressionTemplate(template: string, scope: Scope)
|
|
|
2021
2157
|
|
|
2022
2158
|
export declare const renderTemplate: (template: string, variables: Record<string, unknown>, fallback: string) => string;
|
|
2023
2159
|
|
|
2160
|
+
/** Test seam: forgets ids minted while storage was unavailable. */
|
|
2161
|
+
export declare function resetJourneyIdentityMemoryForTests(): void;
|
|
2162
|
+
|
|
2024
2163
|
/**
|
|
2025
2164
|
* Evaluates all computed variable expressions against the current answers.
|
|
2026
2165
|
* Returns a new answers object with computed values merged in.
|
|
@@ -2060,6 +2199,10 @@ declare function resolveJourneyFontFamily(fontFamily: string | undefined): strin
|
|
|
2060
2199
|
export { resolveJourneyFontFamily }
|
|
2061
2200
|
export { resolveJourneyFontFamily as resolveJourneyFontFamily_alias_1 }
|
|
2062
2201
|
|
|
2202
|
+
declare function resolveJourneyIdentity(options: JourneyIdentityOptions, storage: Storage | null, now?: () => number): JourneyCaptureIdentity;
|
|
2203
|
+
export { resolveJourneyIdentity }
|
|
2204
|
+
export { resolveJourneyIdentity as resolveJourneyIdentity_alias_1 }
|
|
2205
|
+
|
|
2063
2206
|
/** Resolve templated strings anywhere inside a plan with `currentPlan` scoped to that plan. */
|
|
2064
2207
|
export declare function resolvePricingPlanTemplates(plan: PricingPlan, answers: JourneyAnswers): PricingPlan;
|
|
2065
2208
|
|
|
@@ -2113,7 +2256,6 @@ export { RoutingRule as RoutingRule_alias_2 }
|
|
|
2113
2256
|
|
|
2114
2257
|
declare type RuntimeIds = {
|
|
2115
2258
|
journeyId: string;
|
|
2116
|
-
visitorId: string;
|
|
2117
2259
|
clientSessionId: string;
|
|
2118
2260
|
queueKey: string;
|
|
2119
2261
|
presentationKey: string;
|
|
@@ -2818,6 +2960,16 @@ export { useJourneyState as useJourneyState_alias_1 }
|
|
|
2818
2960
|
/** Media playback is a presentation side effect; preloading only fetches assets. */
|
|
2819
2961
|
export declare function useJourneyVideo(autoplay: boolean, source?: string): RefObject<HTMLVideoElement | null>;
|
|
2820
2962
|
|
|
2963
|
+
/**
|
|
2964
|
+
* Loads the web fonts a journey uses, by one stylesheet link for each in
|
|
2965
|
+
* the document head. A link stays for the life of the page: another journey
|
|
2966
|
+
* on it, or the same one after an edit, can use the font at once, and a
|
|
2967
|
+
* font is never asked for twice.
|
|
2968
|
+
*/
|
|
2969
|
+
declare function useJourneyWebFonts(config: JourneyConfig): void;
|
|
2970
|
+
export { useJourneyWebFonts }
|
|
2971
|
+
export { useJourneyWebFonts as useJourneyWebFonts_alias_1 }
|
|
2972
|
+
|
|
2821
2973
|
export declare function VideoBlock({ src, previewImage, captions, autoplay, loop, muted, controls, aspectRatio, youtubeId, vimeoId, className, }: VideoBlockProps): JSX.Element;
|
|
2822
2974
|
|
|
2823
2975
|
declare type VideoBlockProps = {
|
|
@@ -2872,4 +3024,7 @@ export { withDeterministicItemIds }
|
|
|
2872
3024
|
export { withDeterministicItemIds as withDeterministicItemIds_alias_1 }
|
|
2873
3025
|
export { withDeterministicItemIds as withDeterministicItemIds_alias_2 }
|
|
2874
3026
|
|
|
3027
|
+
/** FNV-1a over the key, base36, seven characters — as the events SDK computes it. */
|
|
3028
|
+
export declare function writeKeyFingerprint(apiKey: string): string;
|
|
3029
|
+
|
|
2875
3030
|
export { }
|
|
@@ -970,6 +970,22 @@ export { evaluateCondition as evaluateCondition_alias_1 }
|
|
|
970
970
|
|
|
971
971
|
export declare function evaluateSafeExpression(expression: string, scope: Scope): unknown;
|
|
972
972
|
|
|
973
|
+
/** `fhq_consent_<fingerprint>` — the cookie the events SDK remembers consent in. */
|
|
974
|
+
export declare function eventsConsentCookieName(apiKey: string): string;
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* `fhq_id_<key without punctuation, first 16 characters>` — the identity
|
|
978
|
+
* cookie the events SDK shares across subdomains. On init the SDK lets it
|
|
979
|
+
* win over this origin's stored copy, so a visitor identified on `www` is
|
|
980
|
+
* the same person on `app`; the journey reads it for the same reason.
|
|
981
|
+
*/
|
|
982
|
+
export declare function eventsIdentityCookieName(apiKey: string): string;
|
|
983
|
+
|
|
984
|
+
/** `founderhq:events:v2:<first 16 characters of the key>` — the events SDK's key. */
|
|
985
|
+
declare function eventsStorageKey(apiKey: string): string;
|
|
986
|
+
export { eventsStorageKey }
|
|
987
|
+
export { eventsStorageKey as eventsStorageKey_alias_1 }
|
|
988
|
+
|
|
973
989
|
declare type ExitAnimationPreset = "fade-out" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "scale-down" | "blur-out" | "none";
|
|
974
990
|
export { ExitAnimationPreset }
|
|
975
991
|
export { ExitAnimationPreset as ExitAnimationPreset_alias_1 }
|
|
@@ -1013,6 +1029,14 @@ declare type FetchState = {
|
|
|
1013
1029
|
export { FetchState }
|
|
1014
1030
|
export { FetchState as FetchState_alias_1 }
|
|
1015
1031
|
|
|
1032
|
+
/** The hosted events snippet publishes its client as `globalThis.founderhq`. */
|
|
1033
|
+
export declare function findGlobalEventsClient(): JourneyEventsClient | null;
|
|
1034
|
+
|
|
1035
|
+
/** The first family of a CSS font stack, without quotes. */
|
|
1036
|
+
declare function firstFontFamily(stack: string | undefined): string | undefined;
|
|
1037
|
+
export { firstFontFamily }
|
|
1038
|
+
export { firstFontFamily as firstFontFamily_alias_1 }
|
|
1039
|
+
|
|
1016
1040
|
export declare function FloatingLabelBlock({ text, variant, color, gradient, className, }: FloatingLabelBlockProps): JSX.Element;
|
|
1017
1041
|
|
|
1018
1042
|
declare type FloatingLabelBlockProps = {
|
|
@@ -1030,6 +1054,14 @@ export declare const FOUNDERHQ_BASE_URL = "https://app.getfounderhq.com";
|
|
|
1030
1054
|
|
|
1031
1055
|
export declare function getGravityBinShape(id: string): GravityBinShape;
|
|
1032
1056
|
|
|
1057
|
+
/**
|
|
1058
|
+
* The web fonts a journey uses: the font of the whole journey, and the font
|
|
1059
|
+
* of any block or text segment that sets its own. Sorted, without repeats.
|
|
1060
|
+
*/
|
|
1061
|
+
declare function getJourneyWebFontFamilies(config: JourneyConfig): string[];
|
|
1062
|
+
export { getJourneyWebFontFamilies }
|
|
1063
|
+
export { getJourneyWebFontFamilies as getJourneyWebFontFamilies_alias_1 }
|
|
1064
|
+
|
|
1033
1065
|
declare function getScreenNameError(value: string): string | null;
|
|
1034
1066
|
export { getScreenNameError }
|
|
1035
1067
|
export { getScreenNameError as getScreenNameError_alias_1 }
|
|
@@ -1061,6 +1093,17 @@ export { getVariableNameError }
|
|
|
1061
1093
|
export { getVariableNameError as getVariableNameError_alias_1 }
|
|
1062
1094
|
export { getVariableNameError as getVariableNameError_alias_2 }
|
|
1063
1095
|
|
|
1096
|
+
/**
|
|
1097
|
+
* The stylesheet of a web font. Bunny Fonts carries the Google Fonts
|
|
1098
|
+
* catalog under the same names and does not track the visitor, so a
|
|
1099
|
+
* journey can use those fonts without a call to Google. A weight the
|
|
1100
|
+
* family does not have is left out of the answer, and an unknown name
|
|
1101
|
+
* gives an empty stylesheet, so the request never fails the page.
|
|
1102
|
+
*/
|
|
1103
|
+
declare function getWebFontStylesheetUrl(family: string): string;
|
|
1104
|
+
export { getWebFontStylesheetUrl }
|
|
1105
|
+
export { getWebFontStylesheetUrl as getWebFontStylesheetUrl_alias_1 }
|
|
1106
|
+
|
|
1064
1107
|
declare type GradientValue = string | {
|
|
1065
1108
|
from: string;
|
|
1066
1109
|
to: string;
|
|
@@ -1210,6 +1253,11 @@ export { isValidVariableName }
|
|
|
1210
1253
|
export { isValidVariableName as isValidVariableName_alias_1 }
|
|
1211
1254
|
export { isValidVariableName as isValidVariableName_alias_2 }
|
|
1212
1255
|
|
|
1256
|
+
/** If this family is one a journey must load from the web to show it. */
|
|
1257
|
+
declare function isWebFontFamily(family: string | undefined): family is string;
|
|
1258
|
+
export { isWebFontFamily }
|
|
1259
|
+
export { isWebFontFamily as isWebFontFamily_alias_1 }
|
|
1260
|
+
|
|
1213
1261
|
declare type ItemRecord = Record<string, unknown>;
|
|
1214
1262
|
|
|
1215
1263
|
declare function Journey({ apiKey, journeyId, config, baseUrl, storageKey, onEvent, onOpenURL, className, presentation, theme, initialAnswers, initialOptions, onDiscountCodeApply, loadingComponent, errorComponent, capture, identity, }: JourneyProps): JSX.Element;
|
|
@@ -1267,6 +1315,17 @@ declare type JourneyCaptureConfig = JourneyCaptureOptions & {
|
|
|
1267
1315
|
baseUrl: string;
|
|
1268
1316
|
};
|
|
1269
1317
|
|
|
1318
|
+
declare type JourneyCaptureIdentity = {
|
|
1319
|
+
anonymousId?: string;
|
|
1320
|
+
distinctId?: string;
|
|
1321
|
+
/** The analytics session id, known only when an events client is present. */
|
|
1322
|
+
sessionId?: string;
|
|
1323
|
+
/** Where the ids came from; "none" means the visit is cookieless. */
|
|
1324
|
+
source: "events" | "storage" | "none";
|
|
1325
|
+
};
|
|
1326
|
+
export { JourneyCaptureIdentity }
|
|
1327
|
+
export { JourneyCaptureIdentity as JourneyCaptureIdentity_alias_1 }
|
|
1328
|
+
|
|
1270
1329
|
declare type JourneyCaptureOption = false | JourneyCaptureConfig;
|
|
1271
1330
|
export { JourneyCaptureOption }
|
|
1272
1331
|
export { JourneyCaptureOption as JourneyCaptureOption_alias_1 }
|
|
@@ -1287,6 +1346,21 @@ declare type JourneyCaptureOptions = {
|
|
|
1287
1346
|
* bearer credentials and network policy outside the hosted renderer.
|
|
1288
1347
|
*/
|
|
1289
1348
|
transport?: JourneyCaptureTransport;
|
|
1349
|
+
/**
|
|
1350
|
+
* The `@founderhq/events` client whose visitor identity this journey
|
|
1351
|
+
* shares. Left out, the hosted snippet's `globalThis.founderhq` is used
|
|
1352
|
+
* when present. `false` never looks at the page global.
|
|
1353
|
+
*/
|
|
1354
|
+
eventsClient?: JourneyEventsClient | false;
|
|
1355
|
+
/**
|
|
1356
|
+
* Whether a visitor gets a durable anonymous id when no events client is
|
|
1357
|
+
* on the page and no consent choice has been remembered. Defaults to
|
|
1358
|
+
* "granted": a journey response has no cookieless join, so without an id
|
|
1359
|
+
* it belongs to nobody. Pass "denied" while a consent banner is
|
|
1360
|
+
* unanswered, or run `@founderhq/events`, whose consent state the journey
|
|
1361
|
+
* then follows exactly.
|
|
1362
|
+
*/
|
|
1363
|
+
consentDefault?: JourneyEventsConsent;
|
|
1290
1364
|
};
|
|
1291
1365
|
export { JourneyCaptureOptions }
|
|
1292
1366
|
export { JourneyCaptureOptions as JourneyCaptureOptions_alias_1 }
|
|
@@ -1408,6 +1482,52 @@ export { JourneyEventComputedVariables }
|
|
|
1408
1482
|
export { JourneyEventComputedVariables as JourneyEventComputedVariables_alias_1 }
|
|
1409
1483
|
export { JourneyEventComputedVariables as JourneyEventComputedVariables_alias_2 }
|
|
1410
1484
|
|
|
1485
|
+
/**
|
|
1486
|
+
* How a journey learns who the visitor is.
|
|
1487
|
+
*
|
|
1488
|
+
* Rule: whoever loads first mints the anonymous id; the other adopts it.
|
|
1489
|
+
*
|
|
1490
|
+
* 1. An events client is on the page (`@founderhq/events`, passed in by the
|
|
1491
|
+
* host or found at `globalThis.founderhq` from the hosted snippet) and
|
|
1492
|
+
* hands out ids: its distinct id, anonymous id and session id are read at
|
|
1493
|
+
* every capture, so an `identify()` after the journey opened re-labels the
|
|
1494
|
+
* next event. Nothing is minted beside it.
|
|
1495
|
+
* 2. An events client is on the page and hands out no id. Either it runs
|
|
1496
|
+
* cookieless because consent is pending or denied, or the snippet has not
|
|
1497
|
+
* called `init()` yet. Its silence is the consent signal: the journey
|
|
1498
|
+
* writes nothing, and only adopts the state the events SDK left in storage
|
|
1499
|
+
* on an earlier, consented visit. Once the client starts handing out ids,
|
|
1500
|
+
* the next capture carries them.
|
|
1501
|
+
* 3. No events client (none on the page, or one that throws when asked): the
|
|
1502
|
+
* journey mints the anonymous id in the events SDK's own storage shape and
|
|
1503
|
+
* key, so an events client that initialises later on this site finds the
|
|
1504
|
+
* state and adopts the id, exactly as it adopts its own from a previous
|
|
1505
|
+
* visit. A remembered denial or opt-out, or `consentDefault: "denied"`
|
|
1506
|
+
* from the host, stops the mint: then the session carries only its
|
|
1507
|
+
* per-tab client session id.
|
|
1508
|
+
*
|
|
1509
|
+
* The storage key, state shape, identity cookie, and consent cookie below
|
|
1510
|
+
* mirror `packages/events/src/index.ts` (`PersistedState`, `init()`,
|
|
1511
|
+
* `readIdentityCookie`, and `readConsentPreference`). This package is not
|
|
1512
|
+
* in the pnpm workspace, so it cannot import them; `events-identity.test.ts`
|
|
1513
|
+
* pins every literal.
|
|
1514
|
+
*/
|
|
1515
|
+
declare type JourneyEventsClient = {
|
|
1516
|
+
/** The visitor's distinct id, or null while capture is not granted. */
|
|
1517
|
+
getDistinctId(): string | null;
|
|
1518
|
+
/** The anonymous and session ids, or an empty object while not granted. */
|
|
1519
|
+
checkoutMetadata(): {
|
|
1520
|
+
fhq_anonymous_id?: string;
|
|
1521
|
+
fhq_session_id?: string;
|
|
1522
|
+
};
|
|
1523
|
+
};
|
|
1524
|
+
export { JourneyEventsClient }
|
|
1525
|
+
export { JourneyEventsClient as JourneyEventsClient_alias_1 }
|
|
1526
|
+
|
|
1527
|
+
declare type JourneyEventsConsent = "granted" | "denied";
|
|
1528
|
+
export { JourneyEventsConsent }
|
|
1529
|
+
export { JourneyEventsConsent as JourneyEventsConsent_alias_1 }
|
|
1530
|
+
|
|
1411
1531
|
declare const JourneyHapticContext: Context<JourneyHapticHandler | null>;
|
|
1412
1532
|
export { JourneyHapticContext }
|
|
1413
1533
|
export { JourneyHapticContext as JourneyHapticContext_alias_1 }
|
|
@@ -1428,6 +1548,20 @@ declare type JourneyIdentity = {
|
|
|
1428
1548
|
export { JourneyIdentity }
|
|
1429
1549
|
export { JourneyIdentity as JourneyIdentity_alias_1 }
|
|
1430
1550
|
|
|
1551
|
+
export declare type JourneyIdentityOptions = {
|
|
1552
|
+
apiKey: string;
|
|
1553
|
+
/** `false` never consults `globalThis.founderhq`. */
|
|
1554
|
+
eventsClient?: JourneyEventsClient | false;
|
|
1555
|
+
/**
|
|
1556
|
+
* Applies only with no events client and no remembered consent choice.
|
|
1557
|
+
* Defaults to "granted": a journey response has no cookieless join, so
|
|
1558
|
+
* without an id it belongs to nobody. Pass "denied" while a consent banner
|
|
1559
|
+
* is unanswered, or run `@founderhq/events`, whose consent state the
|
|
1560
|
+
* journey then follows exactly.
|
|
1561
|
+
*/
|
|
1562
|
+
consentDefault?: JourneyEventsConsent;
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1431
1565
|
declare type JourneyOptionOverrides = Record<string, StepOption[]>;
|
|
1432
1566
|
export { JourneyOptionOverrides }
|
|
1433
1567
|
export { JourneyOptionOverrides as JourneyOptionOverrides_alias_1 }
|
|
@@ -2006,6 +2140,8 @@ export declare function RadioGroup({ className, ...props }: React_2.ComponentPro
|
|
|
2006
2140
|
|
|
2007
2141
|
export declare function RadioGroupItem({ className, ...props }: React_2.ComponentProps<typeof RadioGroup_2.Item>): React_2.JSX.Element;
|
|
2008
2142
|
|
|
2143
|
+
export declare function readEventsConsent(apiKey: string): "granted" | "denied" | "off" | null;
|
|
2144
|
+
|
|
2009
2145
|
/** Rewrites typed answer-key references without touching ordinary display copy. */
|
|
2010
2146
|
declare function renameAnswerVariableReferences<T>(value: T, renames: ReadonlyMap<string, string>): T;
|
|
2011
2147
|
export { renameAnswerVariableReferences }
|
|
@@ -2021,6 +2157,9 @@ export declare function renderExpressionTemplate(template: string, scope: Scope)
|
|
|
2021
2157
|
|
|
2022
2158
|
export declare const renderTemplate: (template: string, variables: Record<string, unknown>, fallback: string) => string;
|
|
2023
2159
|
|
|
2160
|
+
/** Test seam: forgets ids minted while storage was unavailable. */
|
|
2161
|
+
export declare function resetJourneyIdentityMemoryForTests(): void;
|
|
2162
|
+
|
|
2024
2163
|
/**
|
|
2025
2164
|
* Evaluates all computed variable expressions against the current answers.
|
|
2026
2165
|
* Returns a new answers object with computed values merged in.
|
|
@@ -2060,6 +2199,10 @@ declare function resolveJourneyFontFamily(fontFamily: string | undefined): strin
|
|
|
2060
2199
|
export { resolveJourneyFontFamily }
|
|
2061
2200
|
export { resolveJourneyFontFamily as resolveJourneyFontFamily_alias_1 }
|
|
2062
2201
|
|
|
2202
|
+
declare function resolveJourneyIdentity(options: JourneyIdentityOptions, storage: Storage | null, now?: () => number): JourneyCaptureIdentity;
|
|
2203
|
+
export { resolveJourneyIdentity }
|
|
2204
|
+
export { resolveJourneyIdentity as resolveJourneyIdentity_alias_1 }
|
|
2205
|
+
|
|
2063
2206
|
/** Resolve templated strings anywhere inside a plan with `currentPlan` scoped to that plan. */
|
|
2064
2207
|
export declare function resolvePricingPlanTemplates(plan: PricingPlan, answers: JourneyAnswers): PricingPlan;
|
|
2065
2208
|
|
|
@@ -2113,7 +2256,6 @@ export { RoutingRule as RoutingRule_alias_2 }
|
|
|
2113
2256
|
|
|
2114
2257
|
declare type RuntimeIds = {
|
|
2115
2258
|
journeyId: string;
|
|
2116
|
-
visitorId: string;
|
|
2117
2259
|
clientSessionId: string;
|
|
2118
2260
|
queueKey: string;
|
|
2119
2261
|
presentationKey: string;
|
|
@@ -2818,6 +2960,16 @@ export { useJourneyState as useJourneyState_alias_1 }
|
|
|
2818
2960
|
/** Media playback is a presentation side effect; preloading only fetches assets. */
|
|
2819
2961
|
export declare function useJourneyVideo(autoplay: boolean, source?: string): RefObject<HTMLVideoElement | null>;
|
|
2820
2962
|
|
|
2963
|
+
/**
|
|
2964
|
+
* Loads the web fonts a journey uses, by one stylesheet link for each in
|
|
2965
|
+
* the document head. A link stays for the life of the page: another journey
|
|
2966
|
+
* on it, or the same one after an edit, can use the font at once, and a
|
|
2967
|
+
* font is never asked for twice.
|
|
2968
|
+
*/
|
|
2969
|
+
declare function useJourneyWebFonts(config: JourneyConfig): void;
|
|
2970
|
+
export { useJourneyWebFonts }
|
|
2971
|
+
export { useJourneyWebFonts as useJourneyWebFonts_alias_1 }
|
|
2972
|
+
|
|
2821
2973
|
export declare function VideoBlock({ src, previewImage, captions, autoplay, loop, muted, controls, aspectRatio, youtubeId, vimeoId, className, }: VideoBlockProps): JSX.Element;
|
|
2822
2974
|
|
|
2823
2975
|
declare type VideoBlockProps = {
|
|
@@ -2872,4 +3024,7 @@ export { withDeterministicItemIds }
|
|
|
2872
3024
|
export { withDeterministicItemIds as withDeterministicItemIds_alias_1 }
|
|
2873
3025
|
export { withDeterministicItemIds as withDeterministicItemIds_alias_2 }
|
|
2874
3026
|
|
|
3027
|
+
/** FNV-1a over the key, base36, seven characters — as the events SDK computes it. */
|
|
3028
|
+
export declare function writeKeyFingerprint(apiKey: string): string;
|
|
3029
|
+
|
|
2875
3030
|
export { }
|