🐛 (embed) Make sure env.ts is not bundled in js embed lib
This commit is contained in:
@ -14,7 +14,8 @@ import {
|
||||
} from '@typebot.io/schemas'
|
||||
import { Log } from '@typebot.io/prisma'
|
||||
import { LiteBadge } from './LiteBadge'
|
||||
import { getViewerUrl, isEmpty, isNotEmpty } from '@typebot.io/lib'
|
||||
import { isNotEmpty } from '@typebot.io/lib'
|
||||
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
|
||||
|
||||
export type TypebotViewerProps = {
|
||||
typebot: Omit<PublicTypebot, 'updatedAt' | 'createdAt'>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/nextjs",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"description": "Convenient library to display typebots on your Next.js website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"description": "Convenient library to display typebots on your React app",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
4
packages/lib/getViewerUrl.ts
Normal file
4
packages/lib/getViewerUrl.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { env } from '@typebot.io/env'
|
||||
|
||||
export const getViewerUrl = () =>
|
||||
env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ?? env.NEXT_PUBLIC_VIEWER_URL[0]
|
@ -1,6 +1,5 @@
|
||||
import got from 'got'
|
||||
import { TelemetryEvent } from '@typebot.io/schemas/features/telemetry'
|
||||
import { isNotEmpty } from '../utils'
|
||||
import { env } from '@typebot.io/env'
|
||||
|
||||
export const sendTelemetryEvents = async (events: TelemetryEvent[]) => {
|
||||
|
@ -19,7 +19,6 @@ import { BubbleBlockType } from '@typebot.io/schemas/features/blocks/bubbles/enu
|
||||
import { LogicBlockType } from '@typebot.io/schemas/features/blocks/logic/enums'
|
||||
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/enums'
|
||||
import { PictureChoiceBlock } from '@typebot.io/schemas/features/blocks/inputs/pictureChoice'
|
||||
import { env } from '@typebot.io/env'
|
||||
|
||||
export const sendRequest = async <ResponseData>(
|
||||
params:
|
||||
@ -257,9 +256,6 @@ export const hasValue = (
|
||||
value !== 'undefined' &&
|
||||
value !== 'null'
|
||||
|
||||
export const getViewerUrl = () =>
|
||||
env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ?? env.NEXT_PUBLIC_VIEWER_URL[0]
|
||||
|
||||
export const parseNumberWithCommas = (num: number) =>
|
||||
num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
|
||||
|
Reference in New Issue
Block a user