diff --git a/apps/builder/.env.local.example b/apps/builder/.env.local.example index 89d60b6f11..4a1e796986 100644 --- a/apps/builder/.env.local.example +++ b/apps/builder/.env.local.example @@ -1,60 +1,14 @@ DATABASE_URL=postgresql://postgres:@localhost:5432/typebot - -ENCRYPTION_SECRET=q3t6v9y$B&E)H@McQfTjWnZr4u7x!z%C #256-bits secret (can be generated here: https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx) +ENCRYPTION_SECRET=SgVkYp2s5v8y/B?E(H+MbQeThWmZq4t6 #256-bits secret (can be generated here: https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx) NEXTAUTH_URL=http://localhost:3000 +NEXT_PUBLIC_VIEWER_URL=http://localhost:3001 -# Used for email auth and email notifications -AUTH_EMAIL_SERVER_USERNAME=username -AUTH_EMAIL_SERVER_PASSWORD=password -AUTH_EMAIL_SERVER_HOST=smtp.example.com -AUTH_EMAIL_SERVER_PORT=587 -AUTH_EMAIL_FROM_EMAIL=noreply@example.com -AUTH_EMAIL_FROM_NAME="John Smith" - -NEXT_PUBLIC_EMAIL_NOTIFICATIONS_FROM_EMAIL= - -# Storage -# Used for uploading images, videos, etc... S3_ACCESS_KEY=minio S3_SECRET_KEY=minio123 S3_BUCKET=typebot S3_PORT=9000 S3_ENDPOINT=localhost S3_SSL=false -# S3_REGION= - -# Auth -# (Optional) Used to login using GitHub -GITHUB_CLIENT_ID= -GITHUB_CLIENT_SECRET= - -# (Optional) Used to login using Google AND Google Sheets integration -GOOGLE_CLIENT_ID= -GOOGLE_CLIENT_SECRET= - -# (Optional) Used to login using Facebook -FACEBOOK_CLIENT_ID= -FACEBOOK_CLIENT_SECRET= - -# (Optional) Subscription Payment -NEXT_PUBLIC_STRIPE_PUBLIC_KEY= -STRIPE_SECRET_KEY= -STRIPE_PRICE_USD_ID= -STRIPE_PRICE_EUR_ID= -STRIPE_WEBHOOK_SECRET= - -# (Optional) Used for GIF search -NEXT_PUBLIC_GIPHY_API_KEY= - -NEXT_PUBLIC_VIEWER_HOST=http://localhost:3001 - -# (Optional) Error tracking with Sentry -NEXT_PUBLIC_SENTRY_DSN= -SENTRY_AUTH_TOKEN= -SENTRY_PROJECT= -SENTRY_ORG= -# Vercel -VERCEL_TOKEN= -VERCEL_VIEWER_PROJECT_NAME= -VERCEL_TEAM_ID= \ No newline at end of file +# For more configuration options check out: +https://docs.typebot.io/self-hosting/configuration \ No newline at end of file diff --git a/apps/builder/components/auth/SignInForm.tsx b/apps/builder/components/auth/SignInForm.tsx index fe74157b25..4592f46398 100644 --- a/apps/builder/components/auth/SignInForm.tsx +++ b/apps/builder/components/auth/SignInForm.tsx @@ -52,26 +52,30 @@ export const SignInForm = ({ return ( - Or with your email - - - - + {process.env.NEXT_PUBLIC_SMTP_FROM && ( + <> + Or with your email + + + + + + )} ) } diff --git a/apps/builder/components/auth/SocialLoginButtons.tsx b/apps/builder/components/auth/SocialLoginButtons.tsx index cc78f0f6d6..3a66429518 100644 --- a/apps/builder/components/auth/SocialLoginButtons.tsx +++ b/apps/builder/components/auth/SocialLoginButtons.tsx @@ -36,24 +36,28 @@ export const SocialLoginButtons = () => { > Continue with GitHub - - + {process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID && ( + + )} + {process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID && ( + + )} ) } diff --git a/apps/builder/components/share/ShareContent.tsx b/apps/builder/components/share/ShareContent.tsx index fa50b03705..82695610f2 100644 --- a/apps/builder/components/share/ShareContent.tsx +++ b/apps/builder/components/share/ShareContent.tsx @@ -54,7 +54,7 @@ export const ShareContent = () => { {typebot && ( toast({ title: e.name, description: e.message }), + onError: (e) => + !toast.isActive('spreadsheets') && + toast({ id: 'spreadsheets', title: e.name, description: e.message }), }) const currentSpreadsheet = useMemo( () => spreadsheets?.find((s) => s.id === spreadsheetId), diff --git a/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SendEmailSettings.tsx b/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SendEmailSettings.tsx index 5e00bcb41d..925f2ef5e4 100644 --- a/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SendEmailSettings.tsx +++ b/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SendEmailSettings.tsx @@ -69,9 +69,9 @@ export const SendEmailSettings = ({ options, onOptionsChange }: Props) => { currentCredentialsId={options.credentialsId} onCredentialsSelect={handleCredentialsSelect} onCreateNewClick={onOpen} - defaultCredentialLabel={ - process.env.NEXT_PUBLIC_EMAIL_NOTIFICATIONS_FROM_EMAIL - } + defaultCredentialLabel={process.env.NEXT_PUBLIC_SMTP_FROM?.match( + /\<(.*)\>/ + )?.pop()} refreshDropdownKey={refreshCredentialsKey} /> diff --git a/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SmtpConfigModal.tsx b/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SmtpConfigModal.tsx index 5c5c55d708..d802a39443 100644 --- a/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SmtpConfigModal.tsx +++ b/apps/builder/components/shared/Graph/Nodes/StepNode/SettingsPopoverContent/bodies/SendEmailSettings/SmtpConfigModal.tsx @@ -78,7 +78,6 @@ export const SmtpConfigModal = ({ - diff --git a/apps/builder/components/shared/SupportBubble.tsx b/apps/builder/components/shared/SupportBubble.tsx index 500c4459d3..d9ba9fd846 100644 --- a/apps/builder/components/shared/SupportBubble.tsx +++ b/apps/builder/components/shared/SupportBubble.tsx @@ -2,6 +2,7 @@ import { useTypebot } from 'contexts/TypebotContext' import { useUser } from 'contexts/UserContext' import { Plan } from 'db' import React, { useEffect } from 'react' +import { isCloudProdInstance } from 'services/utils' import { initBubble } from 'typebot-js' export const SupportBubble = () => { @@ -9,20 +10,21 @@ export const SupportBubble = () => { const { user } = useUser() useEffect(() => { - initBubble({ - publishId: 'typebot-support', - viewerHost: process.env.NEXT_PUBLIC_VIEWER_HOST, - backgroundColor: '#ffffff', - button: { color: '#0042DA' }, - hiddenVariables: { - 'User ID': user?.id, - Name: user?.name ?? undefined, - Email: user?.email ?? undefined, - 'Typebot ID': typebot?.id, - 'Avatar URL': user?.image ?? undefined, - Plan: planToReadable(user?.plan), - }, - }) + if (isCloudProdInstance()) + initBubble({ + publishId: 'typebot-support', + viewerHost: process.env.NEXT_PUBLIC_VIEWER_URL, + backgroundColor: '#ffffff', + button: { color: '#0042DA' }, + hiddenVariables: { + 'User ID': user?.id, + Name: user?.name ?? undefined, + Email: user?.email ?? undefined, + 'Typebot ID': typebot?.id, + 'Avatar URL': user?.image ?? undefined, + Plan: planToReadable(user?.plan), + }, + }) // eslint-disable-next-line react-hooks/exhaustive-deps }, [user, typebot]) diff --git a/apps/builder/libs/google-sheets.ts b/apps/builder/libs/google-sheets.ts index e2ff7115a4..365e687cbd 100644 --- a/apps/builder/libs/google-sheets.ts +++ b/apps/builder/libs/google-sheets.ts @@ -5,7 +5,7 @@ import { decrypt, encrypt } from 'utils' import prisma from './prisma' export const oauth2Client = new OAuth2Client( - process.env.GOOGLE_CLIENT_ID, + process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID, process.env.GOOGLE_CLIENT_SECRET, `${process.env.NEXTAUTH_URL}/api/credentials/google-sheets/callback` ) diff --git a/apps/builder/pages/_document.tsx b/apps/builder/pages/_document.tsx index 8c3c641471..72f394dfdf 100644 --- a/apps/builder/pages/_document.tsx +++ b/apps/builder/pages/_document.tsx @@ -23,11 +23,6 @@ class MyDocument extends Document { href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Open+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" /> -