sitepong 0.1.13 → 0.2.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/cdn/sitepong.min.js +6 -6
- package/dist/cdn/sitepong.min.js.map +1 -1
- package/dist/entries/rn.js +453 -7
- package/dist/entries/rn.js.map +1 -1
- package/dist/entries/web.d.mts +1 -1
- package/dist/entries/web.d.ts +1 -1
- package/dist/entries/web.js +634 -133
- package/dist/entries/web.js.map +1 -1
- package/dist/entries/web.mjs +621 -133
- package/dist/entries/web.mjs.map +1 -1
- package/dist/index.d.mts +349 -21
- package/dist/index.d.ts +349 -21
- package/dist/index.js +307 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +294 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +307 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +294 -3
- package/dist/react/index.mjs.map +1 -1
- package/package.json +162 -160
package/dist/react/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component, ReactNode, ErrorInfo } from 'react';
|
|
2
2
|
import { SitePongInitConfig, ErrorContext, addBreadcrumb, DeviceSignals, WebVitals } from '../index.mjs';
|
|
3
|
-
export { CapturedError, CronCheckinOptions, CronHandle, DatabaseQueryEvent, DatabaseTrackerConfig, DeviceInfo, EnvironmentAdapter, FraudCheckResult, MetricOptions, MutableRNEnvironmentAdapter, PerformanceConfig, PerformanceSpan, PerformanceTransaction, PlatformName, ProfileData, ProfileFrame, ProfilerConfig, RemoteConfig, RemoteConfigFeatures, RemoteConfigSampling, SitePongConfig, TraceContext, TracePropagator, VisitorIdResult, WebManagerFactories, areFlagsReady, captureError, captureMessage, clearAnonymousId, clearUser, client, createTraceContext, cronCheckin, cronStart, cronWrap, dbTrack, dbTrackSync, endSpan, endTransaction, extractTrace, flush, flushMetrics, flushProfiles, generateSpanId, generateTraceId, getAllFlags, getAnonymousId, getDbNPlusOnePatterns, getDbQueryCount, getDeviceSignals, getFlag, getFraudCheck, getLatestProfile, getProfiles, getRemoteConfig, getReplaySessionId, getVariant, getVariantPayload, getVisitorId, getWebVitals, group, identify, init, initRN, isInitialized, isRemoteConfigFeatureEnabled, isReplayRecording, metricDistribution, metricGauge, metricHistogram, metricIncrement, metricStartTimer, metricTime, onRemoteConfigChange, profile, propagateTrace, refreshFlags, registerIdentifyHook, registerWebManagerFactories, resetAnalytics, resetDbQueryCount, setAnonymousId, setContext, setCurrentScreen, setEnvironment, setRNGetCurrentScreen, setTags, setUser, startProfileSpan, startReplay, startSpan, startTransaction, stopReplay, track, trackPageView, waitForFlags } from '../index.mjs';
|
|
3
|
+
export { CapturedError, CronCheckinOptions, CronHandle, DEFAULT_SUPERLINK_ENDPOINT, DatabaseQueryEvent, DatabaseTrackerConfig, DeferredDeepLinkHandler, DeviceInfo, EnvironmentAdapter, FraudCheckResult, MetricOptions, MutableRNEnvironmentAdapter, PerformanceConfig, PerformanceSpan, PerformanceTransaction, PlatformName, ProfileData, ProfileFrame, ProfilerConfig, RemoteConfig, RemoteConfigFeatures, RemoteConfigSampling, ResourceTimingBreakdown, SitePongConfig, SuperLinkClient, SuperLinkConfig, SuperLinkDeepLink, SuperLinkEventType, SuperLinkFingerprint, SuperLinkIdentityMetadata, SuperLinkMatchRequest, SuperLinkMatchResponse, SuperLinkMatchType, SuperLinkPlatform, TraceContext, TracePropagator, VisitorIdResult, WebManagerFactories, areFlagsReady, captureError, captureMessage, captureWebDeepLink, clearAnonymousId, clearUser, client, completeFromScan, createTraceContext, cronCheckin, cronStart, cronWrap, dbTrack, dbTrackSync, endSpan, endTransaction, extractIdentityMetadata, extractTrace, flush, flushMetrics, flushProfiles, generateSpanId, generateTraceId, getAllFlags, getAnonymousId, getDbNPlusOnePatterns, getDbQueryCount, getDeepLink, getDeviceSignals, getFlag, getFraudCheck, getLatestProfile, getMatchedDeepLink, getProfiles, getRemoteConfig, getReplaySessionId, getVariant, getVariantPayload, getVisitorId, getWebVitals, group, identify, init, initRN, initSuperLink, isInitialized, isRemoteConfigFeatureEnabled, isReplayRecording, metricDistribution, metricGauge, metricHistogram, metricIncrement, metricStartTimer, metricTime, onDeferredDeepLink, onRemoteConfigChange, parseUniversalLink, profile, propagateTrace, refreshFlags, registerIdentifyHook, registerWebManagerFactories, resetAnalytics, resetDbQueryCount, setAnonymousId, setContext, setCurrentScreen, setEnvironment, setRNGetCurrentScreen, setTags, setUser, startProfileSpan, startReplay, startSpan, startTransaction, stopReplay, superlinkClient, superlinkIdentify, track, trackPageView, waitForFlags, writeClipboardToken } from '../index.mjs';
|
|
4
4
|
import { C as CaptureContext, U as User } from '../types-Cms9VXx9.mjs';
|
|
5
5
|
import { T as TrackProperties, U as UserTraits, G as GroupTraits } from '../types-BEqbz0tw.mjs';
|
|
6
6
|
export { R as ReplayConfig, a as ReplayEvent } from '../types-BEqbz0tw.mjs';
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component, ReactNode, ErrorInfo } from 'react';
|
|
2
2
|
import { SitePongInitConfig, ErrorContext, addBreadcrumb, DeviceSignals, WebVitals } from '../index.js';
|
|
3
|
-
export { CapturedError, CronCheckinOptions, CronHandle, DatabaseQueryEvent, DatabaseTrackerConfig, DeviceInfo, EnvironmentAdapter, FraudCheckResult, MetricOptions, MutableRNEnvironmentAdapter, PerformanceConfig, PerformanceSpan, PerformanceTransaction, PlatformName, ProfileData, ProfileFrame, ProfilerConfig, RemoteConfig, RemoteConfigFeatures, RemoteConfigSampling, SitePongConfig, TraceContext, TracePropagator, VisitorIdResult, WebManagerFactories, areFlagsReady, captureError, captureMessage, clearAnonymousId, clearUser, client, createTraceContext, cronCheckin, cronStart, cronWrap, dbTrack, dbTrackSync, endSpan, endTransaction, extractTrace, flush, flushMetrics, flushProfiles, generateSpanId, generateTraceId, getAllFlags, getAnonymousId, getDbNPlusOnePatterns, getDbQueryCount, getDeviceSignals, getFlag, getFraudCheck, getLatestProfile, getProfiles, getRemoteConfig, getReplaySessionId, getVariant, getVariantPayload, getVisitorId, getWebVitals, group, identify, init, initRN, isInitialized, isRemoteConfigFeatureEnabled, isReplayRecording, metricDistribution, metricGauge, metricHistogram, metricIncrement, metricStartTimer, metricTime, onRemoteConfigChange, profile, propagateTrace, refreshFlags, registerIdentifyHook, registerWebManagerFactories, resetAnalytics, resetDbQueryCount, setAnonymousId, setContext, setCurrentScreen, setEnvironment, setRNGetCurrentScreen, setTags, setUser, startProfileSpan, startReplay, startSpan, startTransaction, stopReplay, track, trackPageView, waitForFlags } from '../index.js';
|
|
3
|
+
export { CapturedError, CronCheckinOptions, CronHandle, DEFAULT_SUPERLINK_ENDPOINT, DatabaseQueryEvent, DatabaseTrackerConfig, DeferredDeepLinkHandler, DeviceInfo, EnvironmentAdapter, FraudCheckResult, MetricOptions, MutableRNEnvironmentAdapter, PerformanceConfig, PerformanceSpan, PerformanceTransaction, PlatformName, ProfileData, ProfileFrame, ProfilerConfig, RemoteConfig, RemoteConfigFeatures, RemoteConfigSampling, ResourceTimingBreakdown, SitePongConfig, SuperLinkClient, SuperLinkConfig, SuperLinkDeepLink, SuperLinkEventType, SuperLinkFingerprint, SuperLinkIdentityMetadata, SuperLinkMatchRequest, SuperLinkMatchResponse, SuperLinkMatchType, SuperLinkPlatform, TraceContext, TracePropagator, VisitorIdResult, WebManagerFactories, areFlagsReady, captureError, captureMessage, captureWebDeepLink, clearAnonymousId, clearUser, client, completeFromScan, createTraceContext, cronCheckin, cronStart, cronWrap, dbTrack, dbTrackSync, endSpan, endTransaction, extractIdentityMetadata, extractTrace, flush, flushMetrics, flushProfiles, generateSpanId, generateTraceId, getAllFlags, getAnonymousId, getDbNPlusOnePatterns, getDbQueryCount, getDeepLink, getDeviceSignals, getFlag, getFraudCheck, getLatestProfile, getMatchedDeepLink, getProfiles, getRemoteConfig, getReplaySessionId, getVariant, getVariantPayload, getVisitorId, getWebVitals, group, identify, init, initRN, initSuperLink, isInitialized, isRemoteConfigFeatureEnabled, isReplayRecording, metricDistribution, metricGauge, metricHistogram, metricIncrement, metricStartTimer, metricTime, onDeferredDeepLink, onRemoteConfigChange, parseUniversalLink, profile, propagateTrace, refreshFlags, registerIdentifyHook, registerWebManagerFactories, resetAnalytics, resetDbQueryCount, setAnonymousId, setContext, setCurrentScreen, setEnvironment, setRNGetCurrentScreen, setTags, setUser, startProfileSpan, startReplay, startSpan, startTransaction, stopReplay, superlinkClient, superlinkIdentify, track, trackPageView, waitForFlags, writeClipboardToken } from '../index.js';
|
|
4
4
|
import { C as CaptureContext, U as User } from '../types-DQSv7JAE.js';
|
|
5
5
|
import { T as TrackProperties, U as UserTraits, G as GroupTraits } from '../types-BEqbz0tw.js';
|
|
6
6
|
export { R as ReplayConfig, a as ReplayEvent } from '../types-BEqbz0tw.js';
|
package/dist/react/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
|
+
require('web-vitals');
|
|
4
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
|
|
6
7
|
// src/react/provider.tsx
|
|
@@ -1910,6 +1911,292 @@ var TracePropagator = class {
|
|
|
1910
1911
|
}
|
|
1911
1912
|
};
|
|
1912
1913
|
|
|
1914
|
+
// src/superlink/client.ts
|
|
1915
|
+
var DEFAULT_SUPERLINK_ENDPOINT = "https://pongl.ink";
|
|
1916
|
+
var SuperLinkClient = class {
|
|
1917
|
+
constructor(config = {}) {
|
|
1918
|
+
this.config = {
|
|
1919
|
+
endpoint: stripTrailingSlash(config.endpoint || DEFAULT_SUPERLINK_ENDPOINT),
|
|
1920
|
+
appId: config.appId,
|
|
1921
|
+
installId: config.installId,
|
|
1922
|
+
debug: config.debug ?? false
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
/** Replace config in place (used by init() so module-level helpers see updates). */
|
|
1926
|
+
configure(config) {
|
|
1927
|
+
if (config.endpoint) this.config.endpoint = stripTrailingSlash(config.endpoint);
|
|
1928
|
+
if (config.appId !== void 0) this.config.appId = config.appId;
|
|
1929
|
+
if (config.installId !== void 0) this.config.installId = config.installId;
|
|
1930
|
+
if (config.debug !== void 0) this.config.debug = config.debug;
|
|
1931
|
+
}
|
|
1932
|
+
log(...args) {
|
|
1933
|
+
if (this.config.debug) console.warn("[SuperLink]", ...args);
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* POST /match — ask the redirect engine to resolve a deferred deep link from
|
|
1937
|
+
* a click token (Android referrer / iOS clipboard) and/or a device
|
|
1938
|
+
* fingerprint. Returns `{ matched: false }` on any error.
|
|
1939
|
+
*/
|
|
1940
|
+
async match(body) {
|
|
1941
|
+
const payload = {
|
|
1942
|
+
...body,
|
|
1943
|
+
install_id: body.install_id ?? this.config.installId
|
|
1944
|
+
};
|
|
1945
|
+
try {
|
|
1946
|
+
const res = await fetch(`${this.config.endpoint}/match`, {
|
|
1947
|
+
method: "POST",
|
|
1948
|
+
headers: { "Content-Type": "application/json" },
|
|
1949
|
+
body: JSON.stringify(payload)
|
|
1950
|
+
});
|
|
1951
|
+
if (!res.ok) {
|
|
1952
|
+
this.log("match failed", res.status);
|
|
1953
|
+
return { matched: false };
|
|
1954
|
+
}
|
|
1955
|
+
const data = await res.json();
|
|
1956
|
+
return data ?? { matched: false };
|
|
1957
|
+
} catch (err) {
|
|
1958
|
+
this.log("match error", err);
|
|
1959
|
+
return { matched: false };
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* POST /events — report a lifecycle event (opened / converted) back to the
|
|
1964
|
+
* redirect engine, which fans out to analytics + webhooks. Best-effort.
|
|
1965
|
+
*/
|
|
1966
|
+
async reportEvent(input) {
|
|
1967
|
+
try {
|
|
1968
|
+
const res = await fetch(`${this.config.endpoint}/events`, {
|
|
1969
|
+
method: "POST",
|
|
1970
|
+
headers: { "Content-Type": "application/json" },
|
|
1971
|
+
body: JSON.stringify({
|
|
1972
|
+
app_id: this.config.appId,
|
|
1973
|
+
install_id: this.config.installId,
|
|
1974
|
+
...input
|
|
1975
|
+
})
|
|
1976
|
+
});
|
|
1977
|
+
if (!res.ok) this.log("event failed", input.type, res.status);
|
|
1978
|
+
return res.ok;
|
|
1979
|
+
} catch (err) {
|
|
1980
|
+
this.log("event error", err);
|
|
1981
|
+
return false;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
};
|
|
1985
|
+
function stripTrailingSlash(url) {
|
|
1986
|
+
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
1987
|
+
}
|
|
1988
|
+
var superlinkClient = new SuperLinkClient();
|
|
1989
|
+
|
|
1990
|
+
// src/superlink/parse.ts
|
|
1991
|
+
var UTM_KEYS = [
|
|
1992
|
+
["source", "utm_source"],
|
|
1993
|
+
["medium", "utm_medium"],
|
|
1994
|
+
["campaign", "utm_campaign"],
|
|
1995
|
+
["term", "utm_term"],
|
|
1996
|
+
["content", "utm_content"]
|
|
1997
|
+
];
|
|
1998
|
+
function parseUniversalLink(url) {
|
|
1999
|
+
let parsed;
|
|
2000
|
+
try {
|
|
2001
|
+
parsed = new URL(url);
|
|
2002
|
+
} catch {
|
|
2003
|
+
return null;
|
|
2004
|
+
}
|
|
2005
|
+
const params = parsed.searchParams;
|
|
2006
|
+
const utm = {};
|
|
2007
|
+
for (const [key, queryKey] of UTM_KEYS) {
|
|
2008
|
+
const value = params.get(queryKey);
|
|
2009
|
+
if (value) utm[key] = value;
|
|
2010
|
+
}
|
|
2011
|
+
const referral = {};
|
|
2012
|
+
const deep_link_data = {};
|
|
2013
|
+
params.forEach((value, key) => {
|
|
2014
|
+
if (key.startsWith("r_")) {
|
|
2015
|
+
referral[key.slice(2)] = value;
|
|
2016
|
+
} else if (key.startsWith("~")) {
|
|
2017
|
+
deep_link_data[key.slice(1)] = value;
|
|
2018
|
+
}
|
|
2019
|
+
});
|
|
2020
|
+
const explicitPath = params.get("$deep_link_path") ?? params.get("dlp");
|
|
2021
|
+
const deep_link_path = explicitPath ?? (parsed.pathname && parsed.pathname !== "/" ? parsed.pathname : null);
|
|
2022
|
+
return {
|
|
2023
|
+
deep_link_path,
|
|
2024
|
+
deep_link_data,
|
|
2025
|
+
utm,
|
|
2026
|
+
referral,
|
|
2027
|
+
click_id: params.get("click_id"),
|
|
2028
|
+
match_type: "none",
|
|
2029
|
+
confidence: 1
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
// src/superlink/deferred.ts
|
|
2034
|
+
var handlers = /* @__PURE__ */ new Set();
|
|
2035
|
+
var lastMatched = null;
|
|
2036
|
+
function toDeepLink(res) {
|
|
2037
|
+
return {
|
|
2038
|
+
deep_link_path: res.deep_link_path ?? null,
|
|
2039
|
+
deep_link_data: res.deep_link_data ?? {},
|
|
2040
|
+
utm: res.utm ?? {},
|
|
2041
|
+
referral: res.referral ?? {},
|
|
2042
|
+
click_id: res.click_id ?? null,
|
|
2043
|
+
match_type: res.match_type ?? "fingerprint",
|
|
2044
|
+
confidence: res.confidence ?? (res.match_type && res.match_type !== "none" ? 1 : 0)
|
|
2045
|
+
};
|
|
2046
|
+
}
|
|
2047
|
+
function emitDeferredDeepLink(link) {
|
|
2048
|
+
lastMatched = link;
|
|
2049
|
+
for (const handler of handlers) {
|
|
2050
|
+
try {
|
|
2051
|
+
handler(link);
|
|
2052
|
+
} catch (err) {
|
|
2053
|
+
if (superlinkClient.config.debug) console.warn("[SuperLink] handler threw", err);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
function onDeferredDeepLink(handler) {
|
|
2058
|
+
handlers.add(handler);
|
|
2059
|
+
if (lastMatched) {
|
|
2060
|
+
try {
|
|
2061
|
+
handler(lastMatched);
|
|
2062
|
+
} catch {
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
return () => {
|
|
2066
|
+
handlers.delete(handler);
|
|
2067
|
+
};
|
|
2068
|
+
}
|
|
2069
|
+
function getMatchedDeepLink() {
|
|
2070
|
+
return lastMatched;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
// src/superlink/web.ts
|
|
2074
|
+
var STORAGE_KEY3 = "sp_superlink";
|
|
2075
|
+
var captured = null;
|
|
2076
|
+
var didCapture = false;
|
|
2077
|
+
function readStored() {
|
|
2078
|
+
if (typeof sessionStorage === "undefined") return null;
|
|
2079
|
+
try {
|
|
2080
|
+
const raw = sessionStorage.getItem(STORAGE_KEY3);
|
|
2081
|
+
if (!raw) return null;
|
|
2082
|
+
const parsed = JSON.parse(raw);
|
|
2083
|
+
return parsed && typeof parsed === "object" ? parsed : null;
|
|
2084
|
+
} catch {
|
|
2085
|
+
return null;
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
function writeStored(link) {
|
|
2089
|
+
if (typeof sessionStorage === "undefined") return;
|
|
2090
|
+
try {
|
|
2091
|
+
sessionStorage.setItem(STORAGE_KEY3, JSON.stringify(link));
|
|
2092
|
+
} catch {
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
function hasPayload(link) {
|
|
2096
|
+
return Boolean(
|
|
2097
|
+
link.deep_link_path || link.click_id || Object.keys(link.deep_link_data).length > 0 || Object.keys(link.referral).length > 0 || Object.keys(link.utm).length > 0
|
|
2098
|
+
);
|
|
2099
|
+
}
|
|
2100
|
+
function writeClipboardToken(clickId) {
|
|
2101
|
+
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
2102
|
+
const url = `${superlinkClient.config.endpoint}/c/${clickId}`;
|
|
2103
|
+
navigator.clipboard.writeText(url).catch(() => {
|
|
2104
|
+
});
|
|
2105
|
+
}
|
|
2106
|
+
function extractIdentityMetadata(url) {
|
|
2107
|
+
const href = url ?? (typeof window !== "undefined" && window.location ? window.location.href : null);
|
|
2108
|
+
if (!href) return void 0;
|
|
2109
|
+
let loc;
|
|
2110
|
+
try {
|
|
2111
|
+
loc = new URL(href);
|
|
2112
|
+
} catch {
|
|
2113
|
+
return void 0;
|
|
2114
|
+
}
|
|
2115
|
+
const email = loc.searchParams.get("email");
|
|
2116
|
+
const phone = loc.searchParams.get("phone");
|
|
2117
|
+
const userId = loc.searchParams.get("user_id");
|
|
2118
|
+
const id = loc.searchParams.get("id");
|
|
2119
|
+
const customRaw = loc.searchParams.get("custom");
|
|
2120
|
+
const identity = {};
|
|
2121
|
+
if (email) identity.email = email;
|
|
2122
|
+
if (phone) identity.phone = phone;
|
|
2123
|
+
if (userId) identity.user_id = userId;
|
|
2124
|
+
if (id) identity.id = id;
|
|
2125
|
+
if (customRaw) {
|
|
2126
|
+
try {
|
|
2127
|
+
const custom = JSON.parse(decodeURIComponent(customRaw));
|
|
2128
|
+
if (typeof custom === "object" && custom !== null) {
|
|
2129
|
+
identity.custom = custom;
|
|
2130
|
+
}
|
|
2131
|
+
} catch {
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
return Object.keys(identity).length > 0 ? identity : void 0;
|
|
2135
|
+
}
|
|
2136
|
+
function captureWebDeepLink() {
|
|
2137
|
+
if (didCapture) return captured;
|
|
2138
|
+
didCapture = true;
|
|
2139
|
+
const stored = readStored();
|
|
2140
|
+
if (stored) {
|
|
2141
|
+
captured = stored;
|
|
2142
|
+
return captured;
|
|
2143
|
+
}
|
|
2144
|
+
if (typeof window === "undefined" || !window.location) return null;
|
|
2145
|
+
const link = parseUniversalLink(window.location.href);
|
|
2146
|
+
if (link && hasPayload(link)) {
|
|
2147
|
+
captured = link;
|
|
2148
|
+
writeStored(link);
|
|
2149
|
+
void superlinkClient.reportEvent({
|
|
2150
|
+
type: "opened",
|
|
2151
|
+
click_id: link.click_id,
|
|
2152
|
+
platform: "desktop",
|
|
2153
|
+
properties: { surface: "web" }
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
return captured;
|
|
2157
|
+
}
|
|
2158
|
+
function getDeepLink() {
|
|
2159
|
+
if (!didCapture) return captureWebDeepLink();
|
|
2160
|
+
return captured;
|
|
2161
|
+
}
|
|
2162
|
+
function webFingerprint() {
|
|
2163
|
+
const fp = { platform: "desktop" };
|
|
2164
|
+
if (typeof navigator !== "undefined") {
|
|
2165
|
+
if (navigator.userAgent) fp.user_agent = navigator.userAgent;
|
|
2166
|
+
const lang = navigator.language || navigator.languages && navigator.languages[0];
|
|
2167
|
+
if (lang) fp.language = lang;
|
|
2168
|
+
}
|
|
2169
|
+
return fp;
|
|
2170
|
+
}
|
|
2171
|
+
async function identify(identity) {
|
|
2172
|
+
if (!identity || Object.keys(identity).length === 0) return null;
|
|
2173
|
+
const res = await superlinkClient.match({
|
|
2174
|
+
identity,
|
|
2175
|
+
fingerprint: webFingerprint()
|
|
2176
|
+
});
|
|
2177
|
+
if (!res.matched) return null;
|
|
2178
|
+
const link = toDeepLink(res);
|
|
2179
|
+
emitDeferredDeepLink(link);
|
|
2180
|
+
return link;
|
|
2181
|
+
}
|
|
2182
|
+
async function completeFromScan(scanned) {
|
|
2183
|
+
if (!scanned) return null;
|
|
2184
|
+
const res = await superlinkClient.match({
|
|
2185
|
+
qr_token: scanned,
|
|
2186
|
+
fingerprint: webFingerprint()
|
|
2187
|
+
});
|
|
2188
|
+
if (!res.matched) return null;
|
|
2189
|
+
const link = toDeepLink(res);
|
|
2190
|
+
emitDeferredDeepLink(link);
|
|
2191
|
+
return link;
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
// src/superlink/index.ts
|
|
2195
|
+
function initSuperLink(config = {}) {
|
|
2196
|
+
superlinkClient.configure(config);
|
|
2197
|
+
captureWebDeepLink();
|
|
2198
|
+
}
|
|
2199
|
+
|
|
1913
2200
|
// src/index.ts
|
|
1914
2201
|
function installFallbackEnvironment() {
|
|
1915
2202
|
if (getEnvironment()) return;
|
|
@@ -2119,6 +2406,10 @@ var SitePongClient = class {
|
|
|
2119
2406
|
webVitals: config.performance.webVitals,
|
|
2120
2407
|
navigationTiming: config.performance.navigationTiming,
|
|
2121
2408
|
resourceTiming: config.performance.resourceTiming,
|
|
2409
|
+
capturePageLoadTimings: config.performance.capturePageLoadTimings,
|
|
2410
|
+
capturePageRenderTimings: config.performance.capturePageRenderTimings,
|
|
2411
|
+
excludedResourceUrls: config.performance.excludedResourceUrls,
|
|
2412
|
+
resourceNameSanitizer: config.performance.resourceNameSanitizer,
|
|
2122
2413
|
sampleRate: config.performance.sampleRate,
|
|
2123
2414
|
flushInterval: config.performance.flushInterval,
|
|
2124
2415
|
performanceEndpoint: config.performance.performanceEndpoint,
|
|
@@ -2827,7 +3118,7 @@ var areFlagsReady = sitepong.areFlagsReady.bind(sitepong);
|
|
|
2827
3118
|
var refreshFlags = sitepong.refreshFlags.bind(sitepong);
|
|
2828
3119
|
var track = sitepong.track.bind(sitepong);
|
|
2829
3120
|
var trackPageView = sitepong.trackPageView.bind(sitepong);
|
|
2830
|
-
var
|
|
3121
|
+
var identify2 = sitepong.identify.bind(sitepong);
|
|
2831
3122
|
var group = sitepong.group.bind(sitepong);
|
|
2832
3123
|
var resetAnalytics = sitepong.resetAnalytics.bind(sitepong);
|
|
2833
3124
|
var getVisitorId = sitepong.getVisitorId.bind(sitepong);
|
|
@@ -3039,7 +3330,7 @@ function useTrackPageView() {
|
|
|
3039
3330
|
function useIdentify() {
|
|
3040
3331
|
return react.useCallback(
|
|
3041
3332
|
(userId, traits) => {
|
|
3042
|
-
|
|
3333
|
+
identify2(userId, traits);
|
|
3043
3334
|
},
|
|
3044
3335
|
[]
|
|
3045
3336
|
);
|
|
@@ -3235,17 +3526,21 @@ function useReplay() {
|
|
|
3235
3526
|
return { recording, start, stop };
|
|
3236
3527
|
}
|
|
3237
3528
|
|
|
3529
|
+
exports.DEFAULT_SUPERLINK_ENDPOINT = DEFAULT_SUPERLINK_ENDPOINT;
|
|
3238
3530
|
exports.SitePongContext = SitePongContext;
|
|
3239
3531
|
exports.SitePongErrorBoundary = SitePongErrorBoundary;
|
|
3240
3532
|
exports.SitePongProvider = SitePongProvider;
|
|
3533
|
+
exports.SuperLinkClient = SuperLinkClient;
|
|
3241
3534
|
exports.TracePropagator = TracePropagator;
|
|
3242
3535
|
exports.addBreadcrumb = addBreadcrumb;
|
|
3243
3536
|
exports.areFlagsReady = areFlagsReady;
|
|
3244
3537
|
exports.captureError = captureError;
|
|
3245
3538
|
exports.captureMessage = captureMessage;
|
|
3539
|
+
exports.captureWebDeepLink = captureWebDeepLink;
|
|
3246
3540
|
exports.clearAnonymousId = clearAnonymousId;
|
|
3247
3541
|
exports.clearUser = clearUser;
|
|
3248
3542
|
exports.client = sitepong;
|
|
3543
|
+
exports.completeFromScan = completeFromScan;
|
|
3249
3544
|
exports.createTraceContext = createTraceContext;
|
|
3250
3545
|
exports.cronCheckin = cronCheckin;
|
|
3251
3546
|
exports.cronStart = cronStart;
|
|
@@ -3254,6 +3549,7 @@ exports.dbTrack = dbTrack;
|
|
|
3254
3549
|
exports.dbTrackSync = dbTrackSync;
|
|
3255
3550
|
exports.endSpan = endSpan;
|
|
3256
3551
|
exports.endTransaction = endTransaction;
|
|
3552
|
+
exports.extractIdentityMetadata = extractIdentityMetadata;
|
|
3257
3553
|
exports.extractTrace = extractTrace;
|
|
3258
3554
|
exports.flush = flush;
|
|
3259
3555
|
exports.flushMetrics = flushMetrics;
|
|
@@ -3264,10 +3560,12 @@ exports.getAllFlags = getAllFlags;
|
|
|
3264
3560
|
exports.getAnonymousId = getAnonymousId;
|
|
3265
3561
|
exports.getDbNPlusOnePatterns = getDbNPlusOnePatterns;
|
|
3266
3562
|
exports.getDbQueryCount = getDbQueryCount;
|
|
3563
|
+
exports.getDeepLink = getDeepLink;
|
|
3267
3564
|
exports.getDeviceSignals = getDeviceSignals;
|
|
3268
3565
|
exports.getFlag = getFlag;
|
|
3269
3566
|
exports.getFraudCheck = getFraudCheck;
|
|
3270
3567
|
exports.getLatestProfile = getLatestProfile;
|
|
3568
|
+
exports.getMatchedDeepLink = getMatchedDeepLink;
|
|
3271
3569
|
exports.getProfiles = getProfiles;
|
|
3272
3570
|
exports.getRemoteConfig = getRemoteConfig;
|
|
3273
3571
|
exports.getReplaySessionId = getReplaySessionId;
|
|
@@ -3276,9 +3574,10 @@ exports.getVariantPayload = getVariantPayload2;
|
|
|
3276
3574
|
exports.getVisitorId = getVisitorId;
|
|
3277
3575
|
exports.getWebVitals = getWebVitals;
|
|
3278
3576
|
exports.group = group;
|
|
3279
|
-
exports.identify =
|
|
3577
|
+
exports.identify = identify2;
|
|
3280
3578
|
exports.init = init;
|
|
3281
3579
|
exports.initRN = initRN;
|
|
3580
|
+
exports.initSuperLink = initSuperLink;
|
|
3282
3581
|
exports.isInitialized = isInitialized;
|
|
3283
3582
|
exports.isRemoteConfigFeatureEnabled = isRemoteConfigFeatureEnabled;
|
|
3284
3583
|
exports.isReplayRecording = isReplayRecording;
|
|
@@ -3288,7 +3587,9 @@ exports.metricHistogram = metricHistogram;
|
|
|
3288
3587
|
exports.metricIncrement = metricIncrement;
|
|
3289
3588
|
exports.metricStartTimer = metricStartTimer;
|
|
3290
3589
|
exports.metricTime = metricTime;
|
|
3590
|
+
exports.onDeferredDeepLink = onDeferredDeepLink;
|
|
3291
3591
|
exports.onRemoteConfigChange = onRemoteConfigChange;
|
|
3592
|
+
exports.parseUniversalLink = parseUniversalLink;
|
|
3292
3593
|
exports.profile = profile;
|
|
3293
3594
|
exports.propagateTrace = propagateTrace;
|
|
3294
3595
|
exports.refreshFlags = refreshFlags;
|
|
@@ -3308,6 +3609,8 @@ exports.startReplay = startReplay;
|
|
|
3308
3609
|
exports.startSpan = startSpan;
|
|
3309
3610
|
exports.startTransaction = startTransaction;
|
|
3310
3611
|
exports.stopReplay = stopReplay;
|
|
3612
|
+
exports.superlinkClient = superlinkClient;
|
|
3613
|
+
exports.superlinkIdentify = identify;
|
|
3311
3614
|
exports.track = track;
|
|
3312
3615
|
exports.trackPageView = trackPageView;
|
|
3313
3616
|
exports.useAddBreadcrumb = useAddBreadcrumb;
|
|
@@ -3330,5 +3633,6 @@ exports.useTrackPageView = useTrackPageView;
|
|
|
3330
3633
|
exports.useVisitorId = useVisitorId;
|
|
3331
3634
|
exports.useWebVitals = useWebVitals;
|
|
3332
3635
|
exports.waitForFlags = waitForFlags;
|
|
3636
|
+
exports.writeClipboardToken = writeClipboardToken;
|
|
3333
3637
|
//# sourceMappingURL=index.js.map
|
|
3334
3638
|
//# sourceMappingURL=index.js.map
|