📈 Track custom domain and WA enabled events
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
} from '@typebot.io/schemas'
|
||||
import { isDefined } from '@typebot.io/lib/utils'
|
||||
import { isWriteWorkspaceForbidden } from '@/features/workspace/helpers/isWriteWorkspaceForbidden'
|
||||
import { trackEvents } from '@typebot.io/lib/telemetry/trackEvents'
|
||||
|
||||
const inputShape = {
|
||||
data: true,
|
||||
@@ -77,6 +78,14 @@ export const createCredentials = authenticatedProcedure
|
||||
id: true,
|
||||
},
|
||||
})
|
||||
if (credentials.type === 'whatsApp')
|
||||
await trackEvents([
|
||||
{
|
||||
workspaceId: workspace.id,
|
||||
userId: user.id,
|
||||
name: 'WhatsApp credentials created',
|
||||
},
|
||||
])
|
||||
return { credentialsId: createdCredentials.id }
|
||||
})
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { customDomainSchema } from '@typebot.io/schemas/features/customDomains'
|
||||
import got, { HTTPError } from 'got'
|
||||
import { env } from '@typebot.io/env'
|
||||
import { isWriteWorkspaceForbidden } from '@/features/workspace/helpers/isWriteWorkspaceForbidden'
|
||||
import { trackEvents } from '@typebot.io/lib/telemetry/trackEvents'
|
||||
|
||||
export const createCustomDomain = authenticatedProcedure
|
||||
.meta({
|
||||
@@ -75,6 +76,17 @@ export const createCustomDomain = authenticatedProcedure
|
||||
},
|
||||
})
|
||||
|
||||
await trackEvents([
|
||||
{
|
||||
name: 'Custom domain added',
|
||||
userId: user.id,
|
||||
workspaceId,
|
||||
data: {
|
||||
domain: name,
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
return { customDomain }
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user