docs: 📝 Update env var and write Configuration doc
This commit is contained in:
@@ -33,7 +33,7 @@ export type TypebotViewerProps = {
|
||||
}
|
||||
export const TypebotViewer = ({
|
||||
typebot,
|
||||
apiHost = process.env.NEXT_PUBLIC_VIEWER_HOST,
|
||||
apiHost = process.env.NEXT_PUBLIC_VIEWER_URL,
|
||||
isPreview = false,
|
||||
onNewLog,
|
||||
onNewBlockVisible,
|
||||
@@ -59,7 +59,7 @@ export const TypebotViewer = ({
|
||||
const handleCompleted = () => onCompleted && onCompleted()
|
||||
|
||||
if (!apiHost)
|
||||
return <p>process.env.NEXT_PUBLIC_VIEWER_HOST is missing in env</p>
|
||||
return <p>process.env.NEXT_PUBLIC_VIEWER_URL is missing in env</p>
|
||||
return (
|
||||
<Frame
|
||||
id="typebot-iframe"
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# Typebot JS library
|
||||
|
||||
[](https://www.npmjs.com/package/typebot-js) [](https://bundlephobia.com/result?p=typebot-js@latest) [](https://travis-ci.com/plausible/typebot-js)
|
||||
|
||||
Frontend library to embed typebots from [Typebot](https://www.typebot.io/).
|
||||
|
||||
## Installation
|
||||
@@ -19,9 +17,9 @@ yarn add typebot-js
|
||||
It exposes 3 functions:
|
||||
|
||||
```ts
|
||||
initContainer();
|
||||
initPopup();
|
||||
initBubble();
|
||||
initContainer()
|
||||
initPopup()
|
||||
initBubble()
|
||||
```
|
||||
|
||||
You can configure them directly in the "Share" tab of your typebot.
|
||||
@@ -29,9 +27,9 @@ You can configure them directly in the "Share" tab of your typebot.
|
||||
Example:
|
||||
|
||||
```ts
|
||||
import { initContainer } from "typebot-js";
|
||||
import { initContainer } from 'typebot-js'
|
||||
|
||||
const plausible = initContainer("container-id", {
|
||||
publishId: "my-app.com",
|
||||
});
|
||||
const plausible = initContainer('container-id', {
|
||||
publishId: 'my-app.com',
|
||||
})
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user