@burdenoff/website-sdk 2026.1031.1 → 2026.1031.3
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 +7 -1
- package/dist/analytics/index.d.mts +41 -1
- package/dist/analytics/index.d.ts +41 -1
- package/dist/analytics/index.js +40 -0
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +38 -1
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/avatar-live-view/index.js +20 -6
- package/dist/avatar-live-view/index.js.map +1 -1
- package/dist/avatar-live-view/index.mjs +20 -6
- package/dist/avatar-live-view/index.mjs.map +1 -1
- package/dist/components/waitlist.js +39 -0
- package/dist/components/waitlist.js.map +1 -1
- package/dist/components/waitlist.mjs +39 -0
- package/dist/components/waitlist.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3857,6 +3857,43 @@ function PricingPage(props) {
|
|
|
3857
3857
|
/* @__PURE__ */ jsxRuntime.jsx(PricingSection, { ...props })
|
|
3858
3858
|
] });
|
|
3859
3859
|
}
|
|
3860
|
+
|
|
3861
|
+
// src/analytics/events.ts
|
|
3862
|
+
var MAX_PROPERTY_LENGTH = 64;
|
|
3863
|
+
var EMAIL_LIKE = /[^\s@]+@[^\s@]+/;
|
|
3864
|
+
function sanitizeWebsiteEventProperties(properties) {
|
|
3865
|
+
const safe = {};
|
|
3866
|
+
if (!properties) return safe;
|
|
3867
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
3868
|
+
if (typeof value === "boolean") {
|
|
3869
|
+
safe[key] = value;
|
|
3870
|
+
} else if (typeof value === "number") {
|
|
3871
|
+
if (Number.isFinite(value)) safe[key] = value;
|
|
3872
|
+
} else if (typeof value === "string") {
|
|
3873
|
+
const trimmed = value.trim();
|
|
3874
|
+
if (trimmed.length > 0 && trimmed.length <= MAX_PROPERTY_LENGTH && !EMAIL_LIKE.test(trimmed)) {
|
|
3875
|
+
safe[key] = trimmed;
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
return safe;
|
|
3880
|
+
}
|
|
3881
|
+
function trackWebsiteEvent(name, properties) {
|
|
3882
|
+
if (typeof window === "undefined") return false;
|
|
3883
|
+
try {
|
|
3884
|
+
const rybbit = window.rybbit;
|
|
3885
|
+
if (typeof rybbit?.event !== "function") return false;
|
|
3886
|
+
const safe = sanitizeWebsiteEventProperties(properties);
|
|
3887
|
+
if (Object.keys(safe).length > 0) {
|
|
3888
|
+
rybbit.event(name, safe);
|
|
3889
|
+
} else {
|
|
3890
|
+
rybbit.event(name);
|
|
3891
|
+
}
|
|
3892
|
+
return true;
|
|
3893
|
+
} catch {
|
|
3894
|
+
return false;
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3860
3897
|
var waitlistPageSchema = zod.z.object({
|
|
3861
3898
|
name: zod.z.string().min(1, "Name is required"),
|
|
3862
3899
|
email: zod.z.string().email("Please enter a valid email address"),
|
|
@@ -4128,6 +4165,7 @@ function WaitlistPage({
|
|
|
4128
4165
|
product?.id || config.productId
|
|
4129
4166
|
);
|
|
4130
4167
|
if (result.success) {
|
|
4168
|
+
trackWebsiteEvent("waitlist.signed_up", { form: "page" });
|
|
4131
4169
|
sonner.toast.success(result.message ?? successMessage);
|
|
4132
4170
|
reset();
|
|
4133
4171
|
} else {
|
|
@@ -4278,6 +4316,7 @@ function WaitlistForm({
|
|
|
4278
4316
|
product?.id || config.productId
|
|
4279
4317
|
);
|
|
4280
4318
|
if (result.success) {
|
|
4319
|
+
trackWebsiteEvent("waitlist.signed_up", { form: "inline" });
|
|
4281
4320
|
sonner.toast.success(result.message ?? "You have been added to the waitlist!");
|
|
4282
4321
|
setEmail("");
|
|
4283
4322
|
setName("");
|
|
@@ -21092,6 +21131,7 @@ exports.shouldRenderSiteFooter = shouldRenderSiteFooter;
|
|
|
21092
21131
|
exports.speechLocaleOf = speechLocaleOf;
|
|
21093
21132
|
exports.splitLeadingHeading = splitLeadingHeading;
|
|
21094
21133
|
exports.stopSpeaking = stopSpeaking;
|
|
21134
|
+
exports.trackWebsiteEvent = trackWebsiteEvent;
|
|
21095
21135
|
exports.useContentPage = useContentPage;
|
|
21096
21136
|
exports.useContentPages = useContentPages;
|
|
21097
21137
|
exports.useExploreChat = useExploreChat;
|