🔊 Capture TypebotPageV2 events
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled

This commit is contained in:
Baptiste Arnaud 2025-10-17 15:51:09 +02:00
parent 07b48c4eeb
commit 7370298dd5
No known key found for this signature in database

View File

@ -1,3 +1,4 @@
import * as Sentry from "@sentry/nextjs";
import { env } from "@typebot.io/env";
import { isNotDefined } from "@typebot.io/lib/utils";
import prisma from "@typebot.io/prisma";
@ -147,6 +148,10 @@ const getTypebotFromPublicId = async (publicId?: string) => {
if (isNotDefined(publishedTypebot)) return null;
const theme = themeSchema.parse(publishedTypebot.theme);
const settings = settingsSchema.parse(publishedTypebot.settings);
if (!publishedTypebot.version) {
Sentry.setTag("typebotId", publishedTypebot.typebotId);
Sentry.captureMessage("Is using TypebotPageV2");
}
return publishedTypebot.version
? {
name: publishedTypebot.typebot.name,
@ -199,6 +204,10 @@ const getTypebotFromCustomDomain = async (customDomain: string) => {
},
});
if (isNotDefined(publishedTypebot)) return null;
if (!publishedTypebot.version) {
Sentry.setTag("typebotId", publishedTypebot.typebotId);
Sentry.captureMessage("Is using TypebotPageV2");
}
const theme = themeSchema.parse(publishedTypebot.theme);
const settings = settingsSchema.parse(publishedTypebot.settings);
return publishedTypebot.version