n8n-nodes-typebot 1.0.1 → 1.0.3

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.
@@ -19,12 +19,20 @@ class TypebotApi {
19
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
20
  },
21
21
  {
22
- displayName: 'Base URL',
22
+ displayName: 'Management Base URL',
23
23
  name: 'baseUrl',
24
24
  type: 'string',
25
25
  default: 'https://app.typebot.io/api',
26
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.',
27
+ description: 'The base URL for Typebot Management API (Typebots, Folders, Results, Workspaces). Use https://app.typebot.io/api for the cloud version.',
28
+ },
29
+ {
30
+ displayName: 'Chat Base URL',
31
+ name: 'chatBaseUrl',
32
+ type: 'string',
33
+ default: 'https://typebot.io/api',
34
+ required: false,
35
+ description: 'The base URL for Typebot Chat API (Start Chat, Continue Chat). Use https://typebot.io/api for the cloud version. If not set, uses Management Base URL.',
28
36
  },
29
37
  ];
30
38
  this.authenticate = {
@@ -40,6 +48,9 @@ class TypebotApi {
40
48
  baseURL: '={{$credentials.baseUrl}}',
41
49
  url: '/v1/typebots',
42
50
  method: 'GET',
51
+ headers: {
52
+ Authorization: '=Bearer {{$credentials.apiToken}}',
53
+ },
43
54
  },
44
55
  };
45
56
  }
@@ -752,6 +752,7 @@ class Typebot {
752
752
  const returnData = [];
753
753
  const credentials = await this.getCredentials('typebotApi');
754
754
  const baseUrl = credentials.baseUrl;
755
+ const chatBaseUrl = credentials.chatBaseUrl || baseUrl;
755
756
  for (let i = 0; i < items.length; i++) {
756
757
  try {
757
758
  const resource = this.getNodeParameter('resource', i);
@@ -790,7 +791,7 @@ class Typebot {
790
791
  }
791
792
  responseData = await this.helpers.request({
792
793
  method: 'POST',
793
- url: `${baseUrl}/v1/typebots/${publicId}/startChat`,
794
+ url: `${chatBaseUrl}/v1/typebots/${publicId}/startChat`,
794
795
  body,
795
796
  json: true,
796
797
  });
@@ -800,7 +801,7 @@ class Typebot {
800
801
  const message = this.getNodeParameter('message', i);
801
802
  responseData = await this.helpers.request({
802
803
  method: 'POST',
803
- url: `${baseUrl}/v1/sessions/${sessionId}/continueChat`,
804
+ url: `${chatBaseUrl}/v1/sessions/${sessionId}/continueChat`,
804
805
  body: { message },
805
806
  json: true,
806
807
  });
@@ -825,7 +826,7 @@ class Typebot {
825
826
  }
826
827
  responseData = await this.helpers.request({
827
828
  method: 'POST',
828
- url: `${baseUrl}/v1/typebots/${typebotId}/preview/startChat`,
829
+ url: `${chatBaseUrl}/v1/typebots/${typebotId}/preview/startChat`,
829
830
  body,
830
831
  json: true,
831
832
  });
@@ -930,7 +931,7 @@ class Typebot {
930
931
  const publicId = this.getNodeParameter('publicId', i);
931
932
  responseData = await this.helpers.request({
932
933
  method: 'GET',
933
- url: `${baseUrl}/v1/publicTypebots/${publicId}`,
934
+ url: `${chatBaseUrl}/v1/publicTypebots/${publicId}`,
934
935
  json: true,
935
936
  });
936
937
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-typebot",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "n8n community node for Typebot - A powerful chatbot builder integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",