2
0

♻️ Migrate from got to ky (#1416)

Closes #1415
This commit is contained in:
Baptiste Arnaud
2024-04-05 09:01:16 +02:00
committed by GitHub
parent ccc7101dd3
commit d96f384e02
59 changed files with 990 additions and 628 deletions

View File

@@ -8,7 +8,7 @@
"license": "ISC",
"dependencies": {
"@typebot.io/schemas": "workspace:*",
"got": "12.6.0",
"ky": "1.2.3",
"posthog-node": "3.1.1",
"@typebot.io/env": "workspace:*"
},

View File

@@ -1,7 +1,7 @@
import { env } from '@typebot.io/env'
import { TelemetryEvent } from '@typebot.io/schemas/features/telemetry'
import { PostHog } from 'posthog-node'
import got from 'got'
import ky from 'ky'
export const trackEvents = async (events: TelemetryEvent[]) => {
if (!env.NEXT_PUBLIC_POSTHOG_KEY) return
@@ -17,7 +17,7 @@ export const trackEvents = async (events: TelemetryEvent[]) => {
})
if (env.USER_CREATED_WEBHOOK_URL) {
try {
await got.post(env.USER_CREATED_WEBHOOK_URL, {
await ky.post(env.USER_CREATED_WEBHOOK_URL, {
json: {
email: event.data.email,
name: event.data.name ? event.data.name.split(' ')[0] : undefined,