-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
523 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Send total results daily digest | ||
|
||
on: | ||
schedule: | ||
- cron: '0 5 * * *' | ||
|
||
jobs: | ||
send: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./packages/scripts | ||
env: | ||
DATABASE_URL: '${{ secrets.DATABASE_URL }}' | ||
TELEMETRY_WEBHOOK_URL: '${{ secrets.TELEMETRY_WEBHOOK_URL }}' | ||
TELEMETRY_WEBHOOK_BEARER_TOKEN: '${{ secrets.TELEMETRY_WEBHOOK_BEARER_TOKEN }}' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: pnpm/[email protected] | ||
- run: pnpm i --frozen-lockfile | ||
- run: pnpm turbo run telemetry:sendTotalResultsDigest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
apps/builder/src/features/telemetry/api/processTelemetryEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { eventSchema } from 'models/features/telemetry' | ||
import { z } from 'zod' | ||
import { PostHog } from 'posthog-node' | ||
import { TRPCError } from '@trpc/server' | ||
import got from 'got' | ||
import { authenticatedProcedure } from '@/utils/server/trpc' | ||
|
||
// Only used for the cloud version of Typebot. It's the way it processes telemetry events and inject it to thrid-party services. | ||
export const processTelemetryEvent = authenticatedProcedure | ||
.meta({ | ||
openapi: { | ||
method: 'POST', | ||
path: '/t/process', | ||
description: | ||
"Only used for the cloud version of Typebot. It's the way it processes telemetry events and inject it to thrid-party services.", | ||
}, | ||
}) | ||
.input( | ||
z.object({ | ||
events: z.array(eventSchema), | ||
}) | ||
) | ||
.output( | ||
z.object({ | ||
message: z.literal('Events injected'), | ||
}) | ||
) | ||
.query(async ({ input: { events }, ctx: { user } }) => { | ||
if (user.email !== process.env.ADMIN_EMAIL) | ||
throw new TRPCError({ | ||
code: 'BAD_REQUEST', | ||
message: 'Only app admin can process telemetry events', | ||
}) | ||
if (!process.env.POSTHOG_API_KEY) | ||
throw new TRPCError({ | ||
code: 'BAD_REQUEST', | ||
message: 'Server does not have POSTHOG_API_KEY configured', | ||
}) | ||
const client = new PostHog(process.env.POSTHOG_API_KEY, { | ||
host: 'https://eu.posthog.com', | ||
}) | ||
|
||
events.forEach(async (event) => { | ||
if (event.name === 'User created') { | ||
client.identify({ | ||
distinctId: event.userId, | ||
properties: event.data, | ||
}) | ||
} | ||
if ( | ||
event.name === 'Workspace created' || | ||
event.name === 'Subscription updated' | ||
) | ||
client.groupIdentify({ | ||
groupType: 'workspace', | ||
groupKey: event.workspaceId, | ||
properties: event.data, | ||
}) | ||
if ( | ||
event.name === 'Typebot created' || | ||
event.name === 'Typebot published' | ||
) | ||
client.groupIdentify({ | ||
groupType: 'typebot', | ||
groupKey: event.typebotId, | ||
properties: { name: event.data.name }, | ||
}) | ||
if ( | ||
event.name === 'User created' && | ||
process.env.USER_CREATED_WEBHOOK_URL | ||
) { | ||
await got.post(process.env.USER_CREATED_WEBHOOK_URL, { | ||
json: { | ||
email: event.data.email, | ||
name: event.data.name ? event.data.name.split(' ')[0] : undefined, | ||
}, | ||
}) | ||
} | ||
const groups: { workspace?: string; typebot?: string } = {} | ||
if ('workspaceId' in event) groups['workspace'] = event.workspaceId | ||
if ('typebotId' in event) groups['typebot'] = event.typebotId | ||
client.capture({ | ||
distinctId: event.userId, | ||
event: event.name, | ||
properties: event.data, | ||
groups, | ||
}) | ||
}) | ||
|
||
await client.shutdownAsync() | ||
|
||
return { message: 'Events injected' } | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9ca17e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
landing-page-v2 – ./apps/landing-page
typebot.io
get-typebot.com
landing-page-v2-typebot-io.vercel.app
landing-page-v2-git-main-typebot-io.vercel.app
www.get-typebot.com
www.typebot.io
9ca17e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
ns8.vn
1stop.au
yobot.me
klujo.com
me.cr8.ai
chat.marius.digital
chatbot.matthesv.de
chatbot.repplai.com
demo.botscientis.us
demo.wemakebots.xyz
forms.webisharp.com
hrbot.robomotion.io
kbsub.wpwakanda.com
live.botscientis.us
mentoria.omelhor.vc
nutrisamirbayde.com
order.maitempah.com
quest.wpwakanda.com
support.wawplus.com
survey1.digienge.io
surveys.essiell.com
test.botscientis.us
test.reventepro.com
typebot.stillio.com
wordsandimagery.com
88584434.therpm.club
92109660.therpm.club
abbonamento.bwell.it
assistent.m-vogel.de
bium.gratirabbit.com
bot.ansuraniphone.my
bot.barrettamario.it
bot.cotemeuplano.com
bot.leadbooster.help
bot.mycompay.reviews
chat.hayurihijab.com
chatbee.agfunnel.com
click.sevenoways.com
connect.growthguy.in
forms.bonanza.design
hello.advergreen.com
kuiz.sistemniaga.com
offer.botscientis.us
sellmycarglasgow.com
talkbot.agfunnel.com
tenorioadvogados.com
uppity.wpwakanda.com
abutton.wpwakanda.com
acelera.maxbot.com.br
aidigitalmarketing.kr
bbutton.wpwakanda.com
bot.coachayongzul.com
bot.digitalpointer.id
bot.eikju.photography
bot.incusservices.com
tarian.theiofoundation.org
ted.meujalecobrasil.com.br
type.dericsoncalari.com.br
bot.pinpointinteractive.com
bot.polychromes-project.com
bot.seidinembroseanchetu.it
chat.semanalimpanome.com.br
chatbot.berbelanjabiz.trade
designguide.techyscouts.com
liveconvert2.kandalearn.com
presente.empresarias.com.mx
sell.sellthemotorhome.co.uk
anamnese.odontopavani.com.br
austin.channelautomation.com
bot.marketingplusmindset.com
bot.seidibergamoseanchetu.it
desabafe.sergiolimajr.com.br
download.venturemarketing.in
jc-app.virtuesocialmedia.com
piazzatorre.barrettamario.it
type.cookieacademyonline.com
upload.atlasoutfittersk9.com
bot.brigadeirosemdrama.com.br
forms.escoladeautomacao.com.br
onboarding.libertydreamcare.ie
type.talitasouzamarques.com.br
agendamento.sergiolimajr.com.br
anamnese.clinicamegasjdr.com.br
bookings.littlepartymonkeys.com
bot.comercializadoraomicron.com
elevateyourmind.groovepages.com
viewer-v2-typebot-io.vercel.app
yourfeedback.comebackreward.com
gerador.verificadordehospedes.com
personal-trainer.barrettamario.it
preagendamento.sergiolimajr.com.br
studiotecnicoimmobiliaremerelli.it
download.thailandmicespecialist.com
register.thailandmicespecialist.com
bot.studiotecnicoimmobiliaremerelli.it
pesquisa.escolamodacomproposito.com.br
anamnese.clinicaramosodontologia.com.br
chrome-os-inquiry-system.itschromeos.com
viewer-v2-git-main-typebot-io.vercel.app
main-menu-for-itschromeos.itschromeos.com
9ca17e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io
9ca17e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./apps/docs
docs-git-main-typebot-io.vercel.app
docs-typebot-io.vercel.app
docs.typebot.io