n8n-nodes-typebot 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +220 -0
- package/dist/credentials/TypebotApi.credentials.d.ts +9 -0
- package/dist/credentials/TypebotApi.credentials.js +47 -0
- package/dist/nodes/Typebot/Typebot.node.d.ts +5 -0
- package/dist/nodes/Typebot/Typebot.node.js +1115 -0
- package/dist/nodes/Typebot/typebot.svg +9 -0
- package/index.js +2 -0
- package/package.json +51 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# n8n-nodes-typebot
|
|
2
|
+
|
|
3
|
+
This is an n8n community node that lets you use [Typebot](https://typebot.io/) in your n8n workflows.
|
|
4
|
+
|
|
5
|
+
Typebot is a powerful open-source chatbot builder that allows you to create conversational apps and forms.
|
|
6
|
+
|
|
7
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Prerequisites](#prerequisites)
|
|
13
|
+
- [Operations](#operations)
|
|
14
|
+
- [Credentials](#credentials)
|
|
15
|
+
- [Compatibility](#compatibility)
|
|
16
|
+
- [Usage](#usage)
|
|
17
|
+
- [Resources](#resources)
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
22
|
+
|
|
23
|
+
### Community Node Installation
|
|
24
|
+
|
|
25
|
+
1. Open your n8n instance
|
|
26
|
+
2. Go to **Settings** > **Community Nodes**
|
|
27
|
+
3. Click **Install**
|
|
28
|
+
4. Enter `n8n-nodes-typebot` in the npm Package Name field
|
|
29
|
+
5. Click **Install**
|
|
30
|
+
|
|
31
|
+
### Manual Installation (for development)
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
cd ~/.n8n/custom
|
|
35
|
+
npm install n8n-nodes-typebot
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
After installation, restart your n8n instance.
|
|
39
|
+
|
|
40
|
+
## Prerequisites
|
|
41
|
+
|
|
42
|
+
You will need:
|
|
43
|
+
|
|
44
|
+
1. A Typebot account (cloud or self-hosted)
|
|
45
|
+
2. An API token from your Typebot account
|
|
46
|
+
|
|
47
|
+
### Getting Your API Token
|
|
48
|
+
|
|
49
|
+
1. Log into your Typebot dashboard at https://app.typebot.io
|
|
50
|
+
2. Navigate to **Settings & Members** → **My account**
|
|
51
|
+
3. Scroll to the **API tokens** section
|
|
52
|
+
4. Click **Create**
|
|
53
|
+
5. Give your token a name and click **Create**
|
|
54
|
+
6. Copy the generated token (you'll need it for n8n credentials)
|
|
55
|
+
|
|
56
|
+
## Operations
|
|
57
|
+
|
|
58
|
+
This node supports all major Typebot API operations:
|
|
59
|
+
|
|
60
|
+
### Chat Operations
|
|
61
|
+
- **Start Chat** - Start a new chat session with a published typebot
|
|
62
|
+
- **Continue Chat** - Continue an existing chat session
|
|
63
|
+
- **Start Preview Chat** - Start a preview chat session (for testing unpublished bots)
|
|
64
|
+
|
|
65
|
+
### Typebot Management
|
|
66
|
+
- **List** - List all typebots in your workspace
|
|
67
|
+
- **Get** - Get a specific typebot by ID
|
|
68
|
+
- **Create** - Create a new typebot
|
|
69
|
+
- **Update** - Update an existing typebot
|
|
70
|
+
- **Delete** - Delete a typebot
|
|
71
|
+
- **Publish** - Publish a typebot
|
|
72
|
+
- **Unpublish** - Unpublish a typebot
|
|
73
|
+
- **Get Published** - Get a published typebot by public ID
|
|
74
|
+
|
|
75
|
+
### Results
|
|
76
|
+
- **List** - List all results for a typebot
|
|
77
|
+
- **Get** - Get a specific result
|
|
78
|
+
- **Delete** - Delete results
|
|
79
|
+
- **Get Stats** - Get statistics for a typebot
|
|
80
|
+
|
|
81
|
+
### Workspaces
|
|
82
|
+
- **List** - List all workspaces
|
|
83
|
+
- **Get** - Get a specific workspace
|
|
84
|
+
- **Create** - Create a new workspace
|
|
85
|
+
- **Update** - Update a workspace
|
|
86
|
+
- **Delete** - Delete a workspace
|
|
87
|
+
- **List Members** - List workspace members
|
|
88
|
+
|
|
89
|
+
### Folders
|
|
90
|
+
- **List** - List all folders in a workspace
|
|
91
|
+
- **Create** - Create a new folder
|
|
92
|
+
- **Update** - Update a folder
|
|
93
|
+
- **Delete** - Delete a folder
|
|
94
|
+
|
|
95
|
+
## Credentials
|
|
96
|
+
|
|
97
|
+
To use this node, you need to set up Typebot API credentials in n8n:
|
|
98
|
+
|
|
99
|
+
1. In n8n, go to **Credentials** → **New**
|
|
100
|
+
2. Search for "Typebot API"
|
|
101
|
+
3. Enter your credentials:
|
|
102
|
+
- **API Token**: Your Typebot API token
|
|
103
|
+
- **Base URL**:
|
|
104
|
+
- For cloud: `https://app.typebot.io/api`
|
|
105
|
+
- For self-hosted: `https://your-domain.com/api`
|
|
106
|
+
4. Click **Save**
|
|
107
|
+
|
|
108
|
+
## Compatibility
|
|
109
|
+
|
|
110
|
+
- Tested with n8n version 1.0.0+
|
|
111
|
+
- Tested with Typebot API v1
|
|
112
|
+
|
|
113
|
+
## Usage
|
|
114
|
+
|
|
115
|
+
### Example 1: Start a Chat Session
|
|
116
|
+
|
|
117
|
+
This example shows how to start a chat with a published typebot:
|
|
118
|
+
|
|
119
|
+
1. Add the **Typebot** node to your workflow
|
|
120
|
+
2. Select **Chat** as the resource
|
|
121
|
+
3. Select **Start Chat** as the operation
|
|
122
|
+
4. Enter your typebot's **Public ID** (found in typebot settings)
|
|
123
|
+
5. Optionally add a message or prefilled variables
|
|
124
|
+
6. Execute the node
|
|
125
|
+
|
|
126
|
+
The node will return:
|
|
127
|
+
- `sessionId` - Use this to continue the conversation
|
|
128
|
+
- `messages` - The bot's response messages
|
|
129
|
+
- `input` - The next expected input from the user
|
|
130
|
+
|
|
131
|
+
### Example 2: Continue a Chat Conversation
|
|
132
|
+
|
|
133
|
+
1. Add another **Typebot** node
|
|
134
|
+
2. Select **Chat** → **Continue Chat**
|
|
135
|
+
3. Enter the `sessionId` from the previous chat start
|
|
136
|
+
4. Enter the user's message
|
|
137
|
+
5. Execute the node
|
|
138
|
+
|
|
139
|
+
### Example 3: Create a New Typebot
|
|
140
|
+
|
|
141
|
+
1. Add the **Typebot** node
|
|
142
|
+
2. Select **Typebot** → **Create**
|
|
143
|
+
3. Enter your **Workspace ID**
|
|
144
|
+
4. Enter the typebot configuration as JSON:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"name": "My New Bot",
|
|
149
|
+
"groups": [],
|
|
150
|
+
"events": [{
|
|
151
|
+
"type": "start",
|
|
152
|
+
"graphCoordinates": { "x": 0, "y": 0 }
|
|
153
|
+
}]
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Example 4: Get Chat Results
|
|
158
|
+
|
|
159
|
+
1. Add the **Typebot** node
|
|
160
|
+
2. Select **Result** → **List**
|
|
161
|
+
3. Enter your **Typebot ID**
|
|
162
|
+
4. Execute to get all conversation results
|
|
163
|
+
|
|
164
|
+
## Tips for Usage
|
|
165
|
+
|
|
166
|
+
### Working with JSON Fields
|
|
167
|
+
|
|
168
|
+
Several operations require JSON input (like creating or updating typebots). You can:
|
|
169
|
+
|
|
170
|
+
1. Use the **Code** node to prepare the JSON data
|
|
171
|
+
2. Reference data from previous nodes using expressions: `{{ $json.fieldName }}`
|
|
172
|
+
3. Use the **Set** node to construct complex objects
|
|
173
|
+
|
|
174
|
+
### Chat Flow Pattern
|
|
175
|
+
|
|
176
|
+
A typical chat flow in n8n might look like:
|
|
177
|
+
|
|
178
|
+
1. **Webhook** node - Receives user message
|
|
179
|
+
2. **Typebot** (Start/Continue Chat) - Processes the message
|
|
180
|
+
3. **IF** node - Check if conversation is complete
|
|
181
|
+
4. **Typebot** (Get Result) - Retrieve final answers
|
|
182
|
+
5. **HTTP Request** - Send response back to user
|
|
183
|
+
|
|
184
|
+
### Error Handling
|
|
185
|
+
|
|
186
|
+
- Enable **Continue On Fail** in node settings to handle errors gracefully
|
|
187
|
+
- The node will return error information in the output if the API request fails
|
|
188
|
+
- Check Typebot API documentation for specific error codes
|
|
189
|
+
|
|
190
|
+
## Resources
|
|
191
|
+
|
|
192
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
193
|
+
- [Typebot documentation](https://docs.typebot.io/)
|
|
194
|
+
- [Typebot API reference](https://docs.typebot.io/api-reference)
|
|
195
|
+
- [GitHub repository](https://github.com/yourusername/n8n-nodes-typebot) (update with your repo URL)
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
[MIT](LICENSE.md)
|
|
200
|
+
|
|
201
|
+
## Support
|
|
202
|
+
|
|
203
|
+
For issues or questions:
|
|
204
|
+
- Open an issue on [GitHub](https://github.com/yourusername/n8n-nodes-typebot/issues)
|
|
205
|
+
- Check the [n8n community forum](https://community.n8n.io/)
|
|
206
|
+
- Refer to [Typebot documentation](https://docs.typebot.io/)
|
|
207
|
+
|
|
208
|
+
## Contributing
|
|
209
|
+
|
|
210
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
211
|
+
|
|
212
|
+
## Version History
|
|
213
|
+
|
|
214
|
+
### 1.0.0
|
|
215
|
+
- Initial release
|
|
216
|
+
- Support for all major Typebot API operations
|
|
217
|
+
- Chat operations (start, continue, preview)
|
|
218
|
+
- Typebot management (CRUD operations)
|
|
219
|
+
- Results management
|
|
220
|
+
- Workspace and folder management
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TypebotApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypebotApi = void 0;
|
|
4
|
+
class TypebotApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'typebotApi';
|
|
7
|
+
this.displayName = 'Typebot API';
|
|
8
|
+
this.documentationUrl = 'https://docs.typebot.io/api-reference/authentication';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Token',
|
|
12
|
+
name: 'apiToken',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: {
|
|
15
|
+
password: true,
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
description: 'The API token for authenticating with Typebot. You can generate one in your Typebot dashboard under Settings & Members > My account > API tokens.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Base URL',
|
|
23
|
+
name: 'baseUrl',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: 'https://app.typebot.io/api',
|
|
26
|
+
required: true,
|
|
27
|
+
description: 'The base URL for your Typebot instance. Use https://app.typebot.io/api for the cloud version, or your self-hosted URL.',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
this.authenticate = {
|
|
31
|
+
type: 'generic',
|
|
32
|
+
properties: {
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: '=Bearer {{$credentials.apiToken}}',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
this.test = {
|
|
39
|
+
request: {
|
|
40
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
41
|
+
url: '/v1/typebots',
|
|
42
|
+
method: 'GET',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.TypebotApi = TypebotApi;
|