@jmp-technologies/analytics 0.1.19 → 0.1.21
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 +11 -0
- package/dist/astro/client.cjs +840 -0
- package/dist/astro/client.cjs.map +1 -0
- package/dist/astro/client.d.cts +28 -0
- package/dist/astro/client.d.ts +28 -0
- package/dist/astro/client.js +69 -0
- package/dist/astro/client.js.map +1 -0
- package/dist/astro/content.cjs +356 -0
- package/dist/astro/content.cjs.map +1 -0
- package/dist/astro/content.d.cts +33 -0
- package/dist/astro/content.d.ts +33 -0
- package/dist/astro/content.js +30 -0
- package/dist/astro/content.js.map +1 -0
- package/dist/astro/integration.cjs +193 -0
- package/dist/astro/integration.cjs.map +1 -0
- package/dist/astro/integration.d.cts +36 -0
- package/dist/astro/integration.d.ts +36 -0
- package/dist/astro/integration.js +36 -0
- package/dist/astro/integration.js.map +1 -0
- package/dist/astro/middleware.cjs +180 -0
- package/dist/astro/middleware.cjs.map +1 -0
- package/dist/astro/middleware.d.cts +19 -0
- package/dist/astro/middleware.d.ts +19 -0
- package/dist/astro/middleware.js +15 -0
- package/dist/astro/middleware.js.map +1 -0
- package/dist/astro/register.cjs +166 -0
- package/dist/astro/register.cjs.map +1 -0
- package/dist/astro/register.d.cts +7 -0
- package/dist/astro/register.d.ts +7 -0
- package/dist/astro/register.js +9 -0
- package/dist/astro/register.js.map +1 -0
- package/dist/chunk-6TDPOZMJ.js +173 -0
- package/dist/chunk-6TDPOZMJ.js.map +1 -0
- package/dist/{chunk-EPNF76VK.js → chunk-DXHJGKIL.js} +2 -2
- package/dist/chunk-GLEOJIKL.js +211 -0
- package/dist/chunk-GLEOJIKL.js.map +1 -0
- package/dist/{chunk-GB37RVJJ.js → chunk-PDOQ2XBW.js} +82 -242
- package/dist/chunk-PDOQ2XBW.js.map +1 -0
- package/dist/chunk-TK4VRDMO.js +19 -0
- package/dist/chunk-TK4VRDMO.js.map +1 -0
- package/dist/chunk-XA55GBSU.js +21 -0
- package/dist/chunk-XA55GBSU.js.map +1 -0
- package/dist/create-jmp-analytics-BdGOgPxl.d.ts +70 -0
- package/dist/create-jmp-analytics-DxhHOmtR.d.cts +70 -0
- package/dist/index.cjs +199 -197
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -341
- package/dist/index.d.ts +16 -341
- package/dist/index.js +7 -5
- package/dist/landing-capture-C8pyZWuF.d.cts +4 -0
- package/dist/landing-capture-C8pyZWuF.d.ts +4 -0
- package/dist/next/content.cjs +135 -88
- package/dist/next/content.cjs.map +1 -1
- package/dist/next/content.d.cts +15 -35
- package/dist/next/content.d.ts +15 -35
- package/dist/next/content.js +30 -159
- package/dist/next/content.js.map +1 -1
- package/dist/next/instrumentation.cjs +64 -29
- package/dist/next/instrumentation.cjs.map +1 -1
- package/dist/next/instrumentation.js +4 -2
- package/dist/next/instrumentation.js.map +1 -1
- package/dist/next/middleware.cjs +68 -36
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.d.cts +6 -9
- package/dist/next/middleware.d.ts +6 -9
- package/dist/next/middleware.js +3 -11
- package/dist/next/middleware.js.map +1 -1
- package/dist/next.cjs +99 -93
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +3 -1
- package/dist/next.d.ts +3 -1
- package/dist/next.js +3 -2
- package/dist/next.js.map +1 -1
- package/dist/react.cjs +99 -93
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -1
- package/dist/react.d.ts +2 -1
- package/dist/react.js +3 -2
- package/dist/site-config-BRuZWGSW.d.cts +46 -0
- package/dist/site-config-hkGMSeT7.d.ts +46 -0
- package/dist/track-page-view-BLS0YfL-.d.ts +9 -0
- package/dist/track-page-view-DfCyWHqe.d.cts +9 -0
- package/dist/types-BtiK_Acj.d.cts +224 -0
- package/dist/types-BtiK_Acj.d.ts +224 -0
- package/docs/astro-integration.md +131 -0
- package/package.json +31 -5
- package/dist/chunk-GB37RVJJ.js.map +0 -1
- /package/dist/{chunk-EPNF76VK.js.map → chunk-DXHJGKIL.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,344 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* - `call` — `tel:` (delegates to existing `trackCallClick`)
|
|
9
|
-
* - `email` — `mailto:` (delegates to existing `trackEmailClick`)
|
|
10
|
-
* - `sms` — `sms:` / `smsto:`
|
|
11
|
-
* - `whatsapp` — `wa.me`, `api.whatsapp.com`, `whatsapp.com/send`
|
|
12
|
-
* - `maps` — Google Maps, Apple Maps, `maps.app.goo.gl`, `geo:`
|
|
13
|
-
* - `booking` — fixed allowlist of common scheduling hosts (see {@link BOOKING_LINK_HOSTS})
|
|
14
|
-
*
|
|
15
|
-
* `linkHost` returned in `contact_click` results is the hostname only — never the full URL
|
|
16
|
-
* (avoids leaking phone numbers in `tel:`/`sms:` URLs and PII-laden booking query strings).
|
|
17
|
-
*/
|
|
18
|
-
type ContactLinkChannel = "sms" | "whatsapp" | "maps" | "booking";
|
|
19
|
-
type ClassifiedContactLink = {
|
|
20
|
-
kind: "call";
|
|
21
|
-
} | {
|
|
22
|
-
kind: "email";
|
|
23
|
-
} | {
|
|
24
|
-
kind: "contact_click";
|
|
25
|
-
channel: ContactLinkChannel;
|
|
26
|
-
linkHost: string | null;
|
|
27
|
-
};
|
|
28
|
-
/** v1 booking hosts (~80%+ SMB coverage). Add hosts here when a client uses something rare. */
|
|
29
|
-
declare const BOOKING_LINK_HOSTS: readonly ["calendly.com", "cal.com", "acuityscheduling.com", "calendar.google.com", "calendar.app.google", "bookings.microsoft.com", "outlook.office.com", "outlook.office365.com", "book.ms", "setmore.com", "simplybook.me", "oncehub.com", "scheduleonce.com", "youcanbook.me", "savvycal.com", "tidycal.com", "zohobookings.com", "square.site", "squareup.com", "meetings.hubspot.com", "jobber.com", "housecallpro.com", "servicetitan.com", "thryv.com", "honeybook.com", "dubsado.com", "fresha.com", "booksy.com", "vagaro.com", "mindbodyonline.com", "mindbody.io", "janeapp.com", "cliniko.com", "practicebetter.io"];
|
|
30
|
-
/** Returns `null` when the link should not be tracked as a contact link. */
|
|
31
|
-
declare function classifyContactHref(href: string): ClassifiedContactLink | null;
|
|
32
|
-
|
|
33
|
-
/** Inline script for Next.js `beforeInteractive` — capture referrer/UTM only (no network). */
|
|
34
|
-
declare function buildLandingCaptureInlineScript(): string;
|
|
35
|
-
|
|
36
|
-
/** Per-site values used when the dashboard profile is missing or fields are empty. */
|
|
37
|
-
type JmpSiteContactFallback = {
|
|
38
|
-
displayName?: string;
|
|
39
|
-
founderName?: string;
|
|
40
|
-
email?: string;
|
|
41
|
-
phone?: string | null;
|
|
42
|
-
linkedin?: string | null;
|
|
43
|
-
hours?: string | null;
|
|
44
|
-
serviceArea?: string | null;
|
|
45
|
-
dashboardDemoUrl?: string;
|
|
46
|
-
profilePhotoSrc?: string;
|
|
47
|
-
privacyUrl?: string;
|
|
48
|
-
termsUrl?: string;
|
|
49
|
-
};
|
|
50
|
-
type JmpSiteDefinition = {
|
|
51
|
-
/** Content tabs this site uses — reported via instrumentation capabilities. */
|
|
52
|
-
contentWrappers: JmpContentWrapper[];
|
|
53
|
-
/**
|
|
54
|
-
* Public site origin (no trailing slash), e.g. `https://example.com`.
|
|
55
|
-
* Used to resolve relative profile image paths in structured data.
|
|
56
|
-
*/
|
|
57
|
-
siteUrl?: string;
|
|
58
|
-
contactFallback?: JmpSiteContactFallback;
|
|
59
|
-
/**
|
|
60
|
-
* `extras` keys to read from the dashboard site profile (hyphenated keys from admin).
|
|
61
|
-
*/
|
|
62
|
-
contactExtraKeys?: {
|
|
63
|
-
founderName?: readonly string[];
|
|
64
|
-
dashboardDemoUrl?: readonly string[];
|
|
65
|
-
profilePhotoSrc?: readonly string[];
|
|
66
|
-
hours?: readonly string[];
|
|
67
|
-
serviceArea?: readonly string[];
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Register site-specific JMP integration options once (typically from `jmp.config.ts`).
|
|
72
|
-
* Call at module load time before server content or instrumentation runs.
|
|
73
|
-
*/
|
|
74
|
-
declare function defineJmpSite(definition: JmpSiteDefinition): JmpSiteDefinition;
|
|
75
|
-
declare function getJmpSiteDefinition(): JmpSiteDefinition | null;
|
|
76
|
-
/** Server content + lead config: env vars + wrappers from {@link defineJmpSite}. */
|
|
77
|
-
declare function getJmpContentConfig(): JmpContentConfig | null;
|
|
1
|
+
export { b as buildLandingCaptureInlineScript } from './landing-capture-C8pyZWuF.cjs';
|
|
2
|
+
import { J as JmpAnalytics } from './create-jmp-analytics-DxhHOmtR.cjs';
|
|
3
|
+
export { B as BOOKING_LINK_HOSTS, C as ClassifiedContactLink, b as ContactLinkChannel, c as classifyContactHref, d as createJmpAnalytics, i as isJmpTrackingConsentGranted, s as setJmpTrackingConsent, a as subscribeJmpTrackingConsent } from './create-jmp-analytics-DxhHOmtR.cjs';
|
|
4
|
+
import { f as JmpContentConfig, k as TrackServerPageViewOptions, J as JmpBlogPost, a as JmpFaqItem, b as JmpSiteProfile, d as JmpTrustBundle, h as JmpAnalyticsConfig } from './types-BtiK_Acj.cjs';
|
|
5
|
+
export { e as JmpContentWrapper, l as JmpCredential, i as JmpEventType, m as JmpPartnerLogo, g as JmpServerRequestLike, c as JmpTestimonial, n as JmpTrustStat, o as JmpTrustSummary, L as LeadMetadata, p as LeadMetadataValue, j as TrackLeadOptions, T as TrackPageViewOptions } from './types-BtiK_Acj.cjs';
|
|
6
|
+
export { J as JmpSiteContactFallback, a as JmpSiteDefinition, d as defineJmpSite, g as getJmpContentConfig, b as getJmpSiteDefinition } from './site-config-BRuZWGSW.cjs';
|
|
78
7
|
|
|
79
8
|
/** Published package version — sent with capabilities for admin readiness. */
|
|
80
|
-
declare const JMP_ANALYTICS_SDK_VERSION = "0.1.
|
|
9
|
+
declare const JMP_ANALYTICS_SDK_VERSION = "0.1.21";
|
|
81
10
|
/** `localStorage` key when {@link JmpAnalyticsConfig.requireConsent} is enabled. */
|
|
82
11
|
declare const JMP_TRACKING_CONSENT_STORAGE_KEY = "jmp_analytics_consent_v1";
|
|
83
|
-
/**
|
|
84
|
-
declare
|
|
85
|
-
|
|
86
|
-
declare function subscribeJmpTrackingConsent(listener: () => void): () => void;
|
|
87
|
-
/**
|
|
88
|
-
* Grant or deny analytics. Persists in `localStorage` when `requireConsent` is used.
|
|
89
|
-
* Call from your cookie banner before tracking runs.
|
|
90
|
-
*/
|
|
91
|
-
declare function setJmpTrackingConsent(granted: boolean): void;
|
|
92
|
-
type JmpEventType = "page_view" | "form_submit" | "call_click" | "email_click" | "contact_click";
|
|
93
|
-
type JmpAnalyticsConfig = {
|
|
94
|
-
/** Dashboard origin, e.g. https://analytics.example.com (no trailing slash) */
|
|
95
|
-
baseUrl: string;
|
|
96
|
-
/** Per-website key from JMP admin */
|
|
97
|
-
trackingKey: string;
|
|
98
|
-
/** Log requests to console */
|
|
99
|
-
debug?: boolean;
|
|
100
|
-
/** Override fetch (tests, React Native) */
|
|
101
|
-
fetchImpl?: typeof fetch;
|
|
102
|
-
/**
|
|
103
|
-
* Suppress duplicate `page_view` for the same path within this window (ms).
|
|
104
|
-
* Helps with React Strict Mode double-mount; typical: 500–1000.
|
|
105
|
-
*/
|
|
106
|
-
pageViewDedupeMs?: number;
|
|
107
|
-
/**
|
|
108
|
-
* When true, no events are sent until {@link setJmpTrackingConsent}(true).
|
|
109
|
-
* Pair with your cookie banner; see `NEXT_PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT`.
|
|
110
|
-
*/
|
|
111
|
-
requireConsent?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* When true, register a single delegated `click` listener that classifies links
|
|
114
|
-
* (SMS, WhatsApp, maps, scheduling) and records them via {@link trackContactClick}.
|
|
115
|
-
*
|
|
116
|
-
* Off by default — pair with privacy disclosure / consent before enabling.
|
|
117
|
-
* `tel:` / `mailto:` continue to use {@link trackCallClick} / {@link trackEmailClick}.
|
|
118
|
-
*
|
|
119
|
-
* Opt out per-link with `data-jmp-no-track` on an `<a>` (or an ancestor).
|
|
120
|
-
*/
|
|
121
|
-
autoTrackContactLinks?: boolean;
|
|
122
|
-
};
|
|
123
|
-
type JmpContentConfig = Pick<JmpAnalyticsConfig, "baseUrl" | "trackingKey" | "debug" | "fetchImpl"> & {
|
|
124
|
-
/**
|
|
125
|
-
* Content wrappers wired in this site's template (blog, faq, trust.*, contact).
|
|
126
|
-
* Reported via POST /api/content/capabilities so unused dashboard tabs stay hidden.
|
|
127
|
-
* Call {@link registerJmpContentWrappers} at startup / deploy.
|
|
128
|
-
*/
|
|
129
|
-
contentWrappers?: JmpContentWrapper[];
|
|
130
|
-
};
|
|
131
|
-
/** Top-level and trust sub-wrappers the client can declare. */
|
|
132
|
-
type JmpContentWrapper = "blog" | "faq" | "contact" | "trust" | "trust.summary" | "trust.testimonials" | "trust.reviews" | "trust.stats" | "trust.logos" | "trust.credentials";
|
|
133
|
-
type JmpBlogPost = {
|
|
134
|
-
id: string;
|
|
135
|
-
title: string;
|
|
136
|
-
slug: string;
|
|
137
|
-
excerpt: string | null;
|
|
138
|
-
body: string;
|
|
139
|
-
seo_title: string | null;
|
|
140
|
-
meta_description: string | null;
|
|
141
|
-
featured_image_url: string | null;
|
|
142
|
-
published_at: string | null;
|
|
143
|
-
updated_at: string;
|
|
144
|
-
};
|
|
145
|
-
type JmpFaqItem = {
|
|
146
|
-
id: string;
|
|
147
|
-
slug: string;
|
|
148
|
-
question: string;
|
|
149
|
-
answer: string;
|
|
150
|
-
category?: string | null;
|
|
151
|
-
sort_order: number;
|
|
152
|
-
updated_at: string;
|
|
153
|
-
};
|
|
154
|
-
type JmpTrustSummary = {
|
|
155
|
-
google_rating: number | null;
|
|
156
|
-
google_review_count: number | null;
|
|
157
|
-
google_reviews_url: string | null;
|
|
158
|
-
yelp_url: string | null;
|
|
159
|
-
trustpilot_url: string | null;
|
|
160
|
-
disclaimer: string | null;
|
|
161
|
-
};
|
|
162
|
-
type JmpTestimonial = {
|
|
163
|
-
id: string;
|
|
164
|
-
slug: string;
|
|
165
|
-
body: string;
|
|
166
|
-
author_name: string;
|
|
167
|
-
author_descriptor: string | null;
|
|
168
|
-
location: string | null;
|
|
169
|
-
/** 1–10 (half-star steps on a 5-star scale; 10 = 5.0 stars). */
|
|
170
|
-
rating: number | null;
|
|
171
|
-
image_url: string | null;
|
|
172
|
-
video_url: string | null;
|
|
173
|
-
/** Optional topic or service line (e.g. roofing). */
|
|
174
|
-
category: string | null;
|
|
175
|
-
/** Site section key — filter like FAQ `category` (e.g. testimonials, reviews). */
|
|
176
|
-
placement: string | null;
|
|
177
|
-
source: string | null;
|
|
178
|
-
/** Optional link to the original review on Google, Yelp, etc. */
|
|
179
|
-
source_url: string | null;
|
|
180
|
-
featured: boolean;
|
|
181
|
-
sort_order: number;
|
|
182
|
-
updated_at: string;
|
|
183
|
-
};
|
|
184
|
-
type JmpTrustStat = {
|
|
185
|
-
id: string;
|
|
186
|
-
slug: string;
|
|
187
|
-
label: string;
|
|
188
|
-
value: string;
|
|
189
|
-
sort_order: number;
|
|
190
|
-
updated_at: string;
|
|
191
|
-
};
|
|
192
|
-
type JmpPartnerLogo = {
|
|
193
|
-
id: string;
|
|
194
|
-
slug: string;
|
|
195
|
-
name: string;
|
|
196
|
-
image_url: string | null;
|
|
197
|
-
link_url: string | null;
|
|
198
|
-
sort_order: number;
|
|
199
|
-
updated_at: string;
|
|
200
|
-
};
|
|
201
|
-
type JmpCredential = {
|
|
202
|
-
id: string;
|
|
203
|
-
slug: string;
|
|
204
|
-
title: string;
|
|
205
|
-
issuer: string | null;
|
|
206
|
-
year: string | null;
|
|
207
|
-
image_url: string | null;
|
|
208
|
-
category: string | null;
|
|
209
|
-
sort_order: number;
|
|
210
|
-
updated_at: string;
|
|
211
|
-
};
|
|
212
|
-
type JmpTrustBundle = {
|
|
213
|
-
summary: JmpTrustSummary;
|
|
214
|
-
testimonials: JmpTestimonial[];
|
|
215
|
-
stats: JmpTrustStat[];
|
|
216
|
-
logos: JmpPartnerLogo[];
|
|
217
|
-
credentials: JmpCredential[];
|
|
218
|
-
};
|
|
219
|
-
type JmpSiteProfile = {
|
|
220
|
-
name: string;
|
|
221
|
-
display_name: string | null;
|
|
222
|
-
email: string | null;
|
|
223
|
-
phone: string | null;
|
|
224
|
-
address: string | null;
|
|
225
|
-
hours: string | null;
|
|
226
|
-
service_area: string | null;
|
|
227
|
-
google_maps_url: string | null;
|
|
228
|
-
social: {
|
|
229
|
-
linkedin: string | null;
|
|
230
|
-
instagram: string | null;
|
|
231
|
-
facebook: string | null;
|
|
232
|
-
x: string | null;
|
|
233
|
-
youtube: string | null;
|
|
234
|
-
};
|
|
235
|
-
cta: {
|
|
236
|
-
label: string | null;
|
|
237
|
-
url: string | null;
|
|
238
|
-
};
|
|
239
|
-
legal: {
|
|
240
|
-
privacy_policy_url: string | null;
|
|
241
|
-
terms_url: string | null;
|
|
242
|
-
};
|
|
243
|
-
/** Developer-defined keys; values filled by the client. */
|
|
244
|
-
extras: Record<string, string | null>;
|
|
245
|
-
};
|
|
246
|
-
type TrackPageViewOptions = {
|
|
247
|
-
path?: string;
|
|
248
|
-
source?: string;
|
|
249
|
-
device?: string;
|
|
250
|
-
country?: string;
|
|
251
|
-
metadata?: Record<string, unknown>;
|
|
252
|
-
};
|
|
253
|
-
type TrackLeadOptions = {
|
|
254
|
-
/** Path where the lead was submitted, e.g. /contact */
|
|
255
|
-
path?: string;
|
|
256
|
-
name?: string;
|
|
257
|
-
email?: string;
|
|
258
|
-
phone?: string;
|
|
259
|
-
company?: string;
|
|
260
|
-
website?: string;
|
|
261
|
-
subject?: string;
|
|
262
|
-
message?: string;
|
|
263
|
-
/**
|
|
264
|
-
* Optional flexible metadata for dynamic lead forms.
|
|
265
|
-
* Prefer the normalized envelope (formId/formVersion/answers/derived/attribution),
|
|
266
|
-
* but unknown keys are also accepted by the API.
|
|
267
|
-
*/
|
|
268
|
-
metadata?: LeadMetadata;
|
|
269
|
-
/**
|
|
270
|
-
* Optional session id (from createJmpAnalytics internal session) if your app wants to pass it explicitly.
|
|
271
|
-
* Most callers should omit this.
|
|
272
|
-
*/
|
|
273
|
-
sessionId?: string;
|
|
274
|
-
};
|
|
275
|
-
type LeadMetadataValue = string | number | boolean | null | undefined | LeadMetadataValue[] | {
|
|
276
|
-
[key: string]: LeadMetadataValue;
|
|
277
|
-
};
|
|
278
|
-
type LeadMetadata = {
|
|
279
|
-
formId?: string;
|
|
280
|
-
formVersion?: string;
|
|
281
|
-
leadKind?: string;
|
|
282
|
-
answers?: Record<string, LeadMetadataValue>;
|
|
283
|
-
derived?: Record<string, LeadMetadataValue>;
|
|
284
|
-
attribution?: {
|
|
285
|
-
utm_source?: string;
|
|
286
|
-
utm_medium?: string;
|
|
287
|
-
utm_campaign?: string;
|
|
288
|
-
utm_content?: string;
|
|
289
|
-
utm_term?: string;
|
|
290
|
-
gclid?: string;
|
|
291
|
-
fbclid?: string;
|
|
292
|
-
msclkid?: string;
|
|
293
|
-
ttclid?: string;
|
|
294
|
-
[key: string]: LeadMetadataValue | undefined;
|
|
295
|
-
};
|
|
296
|
-
tags?: string[];
|
|
297
|
-
[key: string]: LeadMetadataValue | undefined;
|
|
298
|
-
};
|
|
299
|
-
type JmpServerRequestLike = {
|
|
300
|
-
url?: string;
|
|
301
|
-
headers: Pick<Headers, "get"> | Record<string, string | string[] | undefined | null>;
|
|
302
|
-
};
|
|
303
|
-
type TrackServerPageViewOptions = {
|
|
304
|
-
request?: JmpServerRequestLike;
|
|
305
|
-
/** Overrides request URL path. Use pathname + search when possible. */
|
|
306
|
-
path?: string;
|
|
307
|
-
/** Original visitor user agent. Useful when not passing `request`. */
|
|
308
|
-
userAgent?: string | null;
|
|
309
|
-
/** Original visitor referrer. Useful when not passing `request`. */
|
|
310
|
-
referer?: string | null;
|
|
311
|
-
metadata?: Record<string, unknown>;
|
|
312
|
-
sessionId?: string;
|
|
313
|
-
};
|
|
314
|
-
/**
|
|
315
|
-
* Create a tracker instance. Safe to call once per app and reuse.
|
|
316
|
-
*/
|
|
317
|
-
declare function createJmpAnalytics(config: JmpAnalyticsConfig): {
|
|
318
|
-
track: (type: JmpEventType, payload: {
|
|
319
|
-
path: string;
|
|
320
|
-
metadata?: Record<string, unknown>;
|
|
321
|
-
source?: string;
|
|
322
|
-
device?: string;
|
|
323
|
-
country?: string;
|
|
324
|
-
}) => Promise<void>;
|
|
325
|
-
trackPageView: (options?: TrackPageViewOptions) => Promise<void>;
|
|
326
|
-
trackFormSubmit: (path: string, metadata?: Record<string, unknown>) => Promise<void>;
|
|
327
|
-
trackCallClick: (path: string, metadata?: Record<string, unknown>) => Promise<void>;
|
|
328
|
-
trackEmailClick: (path: string, metadata?: Record<string, unknown>) => Promise<void>;
|
|
329
|
-
trackContactClick: (path: string, options: {
|
|
330
|
-
channel: ContactLinkChannel;
|
|
331
|
-
linkHost?: string | null;
|
|
332
|
-
metadata?: Record<string, unknown>;
|
|
333
|
-
}) => Promise<void>;
|
|
334
|
-
trackLead: (options?: TrackLeadOptions) => Promise<void>;
|
|
335
|
-
subscribeToSpaNavigation: () => () => void;
|
|
336
|
-
subscribeContactLinkAutoTrack: () => () => void;
|
|
337
|
-
setTrackingConsent: typeof setJmpTrackingConsent;
|
|
338
|
-
isTrackingConsentGranted: typeof isJmpTrackingConsentGranted;
|
|
339
|
-
};
|
|
340
|
-
type JmpAnalytics = ReturnType<typeof createJmpAnalytics>;
|
|
12
|
+
/** Default `pageViewDedupeMs` when resolving browser config from env (Strict Mode / SPA). */
|
|
13
|
+
declare const DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS = 800;
|
|
14
|
+
|
|
341
15
|
declare function trackJmpServerPageView(config: JmpContentConfig, options?: TrackServerPageViewOptions): Promise<void>;
|
|
16
|
+
|
|
342
17
|
declare function getJmpBlogPosts(config: JmpContentConfig): Promise<JmpBlogPost[]>;
|
|
343
18
|
declare function getJmpBlogPost(config: JmpContentConfig, slug: string): Promise<JmpBlogPost | null>;
|
|
344
19
|
declare function getJmpFaqs(config: JmpContentConfig): Promise<JmpFaqItem[]>;
|
|
@@ -356,6 +31,7 @@ declare function registerJmpContentWrappers(config: JmpContentConfig): Promise<{
|
|
|
356
31
|
ok: false;
|
|
357
32
|
skipped: true;
|
|
358
33
|
}>;
|
|
34
|
+
|
|
359
35
|
declare function createJmpContentClient(config: JmpContentConfig): {
|
|
360
36
|
getBlogPosts: () => Promise<JmpBlogPost[]>;
|
|
361
37
|
getBlogPost: (slug: string) => Promise<JmpBlogPost | null>;
|
|
@@ -371,10 +47,10 @@ declare function createJmpContentClient(config: JmpContentConfig): {
|
|
|
371
47
|
skipped: true;
|
|
372
48
|
}>;
|
|
373
49
|
};
|
|
374
|
-
|
|
375
|
-
|
|
50
|
+
type JmpContentClient = ReturnType<typeof createJmpContentClient>;
|
|
51
|
+
|
|
376
52
|
/**
|
|
377
|
-
* Browser / client bundle: reads
|
|
53
|
+
* Browser / client bundle: reads `NEXT_PUBLIC_*` or Astro `PUBLIC_*` vars.
|
|
378
54
|
* Use for `createJmpAnalytics` on the client. Returns `null` if incomplete.
|
|
379
55
|
*/
|
|
380
56
|
declare function getJmpBrowserAnalyticsConfigFromEnv(overrides?: Partial<JmpAnalyticsConfig>): JmpAnalyticsConfig | null;
|
|
@@ -392,10 +68,9 @@ declare function isJmpServerContentEnvConfigured(): boolean;
|
|
|
392
68
|
* Returns `null` on the server or when public env vars are missing.
|
|
393
69
|
*/
|
|
394
70
|
declare function getOrCreateJmpAnalyticsFromBrowserEnv(overrides?: Partial<JmpAnalyticsConfig>): JmpAnalytics | null;
|
|
395
|
-
type JmpContentClient = ReturnType<typeof createJmpContentClient>;
|
|
396
71
|
/**
|
|
397
72
|
* `createJmpContentClient` using server env resolution. Returns `null` if env is incomplete.
|
|
398
73
|
*/
|
|
399
74
|
declare function createJmpContentClientFromServerEnv(overrides?: Partial<JmpContentConfig>): JmpContentClient | null;
|
|
400
75
|
|
|
401
|
-
export {
|
|
76
|
+
export { DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS, JMP_ANALYTICS_SDK_VERSION, JMP_TRACKING_CONSENT_STORAGE_KEY, JmpAnalytics, JmpAnalyticsConfig, JmpBlogPost, type JmpContentClient, JmpContentConfig, JmpFaqItem, JmpSiteProfile, JmpTrustBundle, TrackServerPageViewOptions, createJmpContentClient, createJmpContentClientFromServerEnv, getJmpBlogPost, getJmpBlogPosts, getJmpBrowserAnalyticsConfigFromEnv, getJmpFaqs, getJmpRobotsTxt, getJmpServerContentConfigFromEnv, getJmpSiteProfile, getJmpTrustBundle, getOrCreateJmpAnalyticsFromBrowserEnv, isJmpBrowserAnalyticsEnvConfigured, isJmpServerContentEnvConfigured, registerJmpContentWrappers, trackJmpServerPageView };
|