n8n-nodes-whatsapp-retentionstack 0.2.0 → 0.3.1

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/README.md CHANGED
@@ -7,7 +7,7 @@ No Meta approval queue. No WhatsApp Business account. 5 minutes from sign-in to
7
7
 
8
8
  ## Credentials
9
9
 
10
- 1. Sign in at [whatsapp-messaging.retentionstack.agency/start](https://whatsapp-messaging.retentionstack.agency/start) and link your number.
10
+ 1. Sign in at [whatsapp-messaging.retentionstack.agency/start](https://whatsapp-messaging.retentionstack.agency/start) and link your number. The free plan has 100 requests a month.
11
11
  2. Copy a key from the console:
12
12
  - Session token (`ch_live_...`): one number. Leave every node's Session field as `default`.
13
13
  - Account key (`ak_live_...`): every number on your account. Enter the session name in each node's Session field.
@@ -15,6 +15,16 @@ No Meta approval queue. No WhatsApp Business account. 5 minutes from sign-in to
15
15
 
16
16
  Upgrading from 0.1.x: earlier versions used a RapidAPI key. Replace it with a session token or account key from the console; RapidAPI keys no longer work with this node.
17
17
 
18
+ ## Linking a number
19
+
20
+ Link each number once, either in the [console](https://whatsapp-messaging.retentionstack.agency/app) or with the Session resource (Get QR Code or Request Pairing Code), then wait for Get to report `WORKING`.
21
+
22
+ If Get reports `PASSKEY_REQUIRED`, WhatsApp wants a passkey. The challenge can only be signed in a browser on web.whatsapp.com with the WhatsApp extension, so the easiest path is to finish linking in the console. To do it from a workflow instead:
23
+
24
+ 1. **Get Passkey Challenge**, and pass the result unchanged to your browser signing step.
25
+ 2. **Submit Passkey** with the signed `credential.toJSON()` object.
26
+ 3. If Get then reports `PASSKEY_CONFIRMATION_REQUIRED`: **Get Passkey Confirmation Code**, check it matches the code on the phone, then **Confirm Passkey**.
27
+
18
28
  ## Nodes
19
29
 
20
30
  **WhatsApp by Retention Stack** (action)
@@ -55,11 +65,14 @@ Dropdown labels follow n8n conventions (for example "Get Many"). The action text
55
65
  | Message | Star | Star or unstar message | `PUT /v1/star` |
56
66
  | Message | Start Typing | Start typing indicator | `POST /v1/startTyping` |
57
67
  | Message | Stop Typing | Stop typing indicator | `POST /v1/stopTyping` |
68
+ | Session | Confirm Passkey | Confirm passkey code | `POST /v1/{session}/auth/passkey/confirm` |
58
69
  | Session | Delete | Delete session | `DELETE /v1/sessions/{session}` |
59
70
  | Session | Get | Get session | `GET /v1/sessions/{session}` |
60
71
  | Session | Get Chat Presence | Get chat presence | `GET /v1/sessions/{session}/presence/{chatId}` |
61
72
  | Session | Get Many | List sessions | `GET /v1/sessions` |
62
73
  | Session | Get Me | Get session me | `GET /v1/sessions/{session}/me` |
74
+ | Session | Get Passkey Challenge | Get passkey challenge | `GET /v1/{session}/auth/passkey/challenge` |
75
+ | Session | Get Passkey Confirmation Code | Get passkey confirmation code | `GET /v1/{session}/auth/passkey/confirmation` |
63
76
  | Session | Get Presence | Get all chats presence | `GET /v1/sessions/{session}/presence` |
64
77
  | Session | Get QR Code | Get QR code | `GET /v1/{session}/auth/qr` |
65
78
  | Session | Logout | Logout session | `POST /v1/sessions/logout` |
@@ -67,6 +80,7 @@ Dropdown labels follow n8n conventions (for example "Get Many"). The action text
67
80
  | Session | Set Presence | Set presence | `POST /v1/sessions/{session}/presence` |
68
81
  | Session | Start | Start session | `POST /v1/sessions/start` |
69
82
  | Session | Stop | Stop session | `POST /v1/sessions/stop` |
83
+ | Session | Submit Passkey | Submit passkey assertion | `POST /v1/{session}/auth/passkey` |
70
84
  | Session | Subscribe Chat Presence | Subscribe to chat presence | `POST /v1/sessions/{session}/presence/{chatId}/subscribe` |
71
85
  | Group | Add Participants | Add participants | `POST /v1/sessions/{session}/groups/{groupId}/participants/add` |
72
86
  | Group | Count | Get groups count | `GET /v1/sessions/{session}/groups/count` |
@@ -100,13 +114,6 @@ Dropdown labels follow n8n conventions (for example "Get Many"). The action text
100
114
  | Contact | Check Exists | Check if phone number exists on WhatsApp | `GET /v1/contacts/check-exists` |
101
115
  <!-- api-map:end -->
102
116
 
103
- ## Setup
104
-
105
- 1. Subscribe on RapidAPI (free plan, 100 requests/month, no credit card): [rapidapi.com/jevil257/api/whatsapp-messaging-bot](https://rapidapi.com/jevil257/api/whatsapp-messaging-bot). Copy your `X-RapidAPI-Key`.
106
- 2. Pair your phone once: run **Session → Start**, then **Session → Get QR Code** and scan it in WhatsApp → Linked Devices. Or follow the [getting started guide](https://whatsapp-messaging.retentionstack.agency/docs).
107
- 3. In n8n, add credentials **WhatsApp by Retention Stack API** and paste the key.
108
- 4. Drop the node into a workflow. Session name defaults to `default`.
109
-
110
117
  ## Install
111
118
 
112
119
  **Self-hosted n8n:** Settings → Community Nodes → Install → `n8n-nodes-whatsapp-retentionstack`.
@@ -135,7 +142,14 @@ npm link # then in ~/.n8n/nodes: npm link n8n-nodes-whatsapp-retentionsta
135
142
  ## Links
136
143
 
137
144
  - API docs: https://whatsapp-messaging.retentionstack.agency/docs
138
- - RapidAPI listing: https://rapidapi.com/jevil257/api/whatsapp-messaging-bot
139
145
  - Issues: https://github.com/jevil25/n8n-nodes-whatsapp-retentionstack/issues
140
146
 
141
147
  MIT © Retention Stack
148
+
149
+ ## Workflow templates
150
+
151
+ Import these from **Workflows → Import from file**, then select your WhatsApp credential in each WhatsApp node:
152
+
153
+ - [Send a WhatsApp OTP from a webhook](templates/whatsapp-otp-webhook.json)
154
+ - [New Google Sheets row to WhatsApp message](templates/google-sheets-row-to-whatsapp.json)
155
+ - [Email alert when a WhatsApp session disconnects](templates/session-disconnect-email-alert.json)
@@ -49,7 +49,7 @@ const str = (displayName, name, resource, ops, extra = {}) => ({
49
49
  ...show(resource, ops),
50
50
  ...extra,
51
51
  });
52
- const session = (resource, ops, routing = {}) => str('Session', 'session', resource, ops, { default: 'default', required: true, description: 'Leave as default with a session token. With an account key, enter the session name.', ...routing });
52
+ const session = (resource, ops, routing = {}) => str('Session', 'session', resource, ops, { default: 'default', required: true, description: 'Leave as default with a session token. With an account key, enter the session name. If the status is PASSKEY_REQUIRED, finish linking in the console at whatsapp-messaging.retentionstack.agency/app or use the passkey operations.', ...routing });
53
53
  const chatId = (resource, ops, routing = body('chatId')) => str('Chat ID', 'chatId', resource, ops, { required: true, placeholder: '1234567890', description: 'Phone number with country code (no +), or a group/channel ID', ...routing });
54
54
  const groupId = (ops) => str('Group ID', 'groupId', 'group', ops, { required: true, placeholder: '120363012345678901@g.us' });
55
55
  const extra = (resource, ops, options) => ({
@@ -162,11 +162,14 @@ const message = [
162
162
  const PRESENCE_CHAT = `/v1/sessions/${S}/presence/{{$parameter.chatId}}`;
163
163
  const sessionProps = [
164
164
  operation('session', [
165
+ op('Confirm Passkey', 'passkeyConfirm', 'POST', `/v1/${S}/auth/passkey/confirm`),
165
166
  op('Delete', 'delete', 'DELETE', `/v1/sessions/${S}`),
166
167
  op('Get', 'get', 'GET', `/v1/sessions/${S}`),
167
168
  op('Get Chat Presence', 'getChatPresence', 'GET', PRESENCE_CHAT),
168
169
  op('Get Many', 'getMany', 'GET', '/v1/sessions'),
169
170
  op('Get Me', 'me', 'GET', `/v1/sessions/${S}/me`),
171
+ op('Get Passkey Challenge', 'passkeyChallenge', 'GET', `/v1/${S}/auth/passkey/challenge`),
172
+ op('Get Passkey Confirmation Code', 'passkeyConfirmation', 'GET', `/v1/${S}/auth/passkey/confirmation`),
170
173
  op('Get Presence', 'getPresence', 'GET', `/v1/sessions/${S}/presence`),
171
174
  op('Get QR Code', 'qr', 'GET', `/v1/${S}/auth/qr`),
172
175
  op('Logout', 'logout', 'POST', '/v1/sessions/logout'),
@@ -174,14 +177,25 @@ const sessionProps = [
174
177
  op('Set Presence', 'setPresence', 'POST', `/v1/sessions/${S}/presence`),
175
178
  op('Start', 'start', 'POST', '/v1/sessions/start'),
176
179
  op('Stop', 'stop', 'POST', '/v1/sessions/stop'),
180
+ op('Submit Passkey', 'passkeySubmit', 'POST', `/v1/${S}/auth/passkey`),
177
181
  op('Subscribe Chat Presence', 'subscribePresence', 'POST', `${PRESENCE_CHAT}/subscribe`),
178
182
  ], 'get'),
179
- session('session', ['delete', 'get', 'getChatPresence', 'me', 'getPresence', 'qr', 'pairingCode', 'subscribePresence']),
183
+ session('session', ['delete', 'get', 'getChatPresence', 'me', 'getPresence', 'qr', 'pairingCode', 'subscribePresence', 'passkeyChallenge', 'passkeySubmit', 'passkeyConfirmation', 'passkeyConfirm']),
180
184
  session('session', ['start', 'stop', 'logout'], body('name')),
181
185
  session('session', ['setPresence'], body('session')),
182
186
  chatId('session', ['getChatPresence', 'subscribePresence'], {}),
183
187
  { displayName: 'Logout', name: 'logout', type: 'boolean', default: false, description: 'Whether to also log out (unpair) when stopping', ...show('session', ['stop']), ...body('logout') },
184
188
  str('Phone Number', 'phoneNumber', 'session', ['pairingCode'], { required: true, placeholder: '1234567890', description: 'Number to pair, with country code', ...body('phoneNumber') }),
189
+ {
190
+ displayName: 'Signed Credential',
191
+ name: 'credential',
192
+ type: 'json',
193
+ default: '{}',
194
+ required: true,
195
+ description: 'The challenge must be signed in a browser on web.whatsapp.com with the WhatsApp extension. Paste the resulting credential.toJSON() object here, unchanged.',
196
+ ...show('session', ['passkeySubmit']),
197
+ routing: { request: { body: '={{ typeof $value === "string" ? JSON.parse($value) : $value }}' } },
198
+ },
185
199
  {
186
200
  displayName: 'Presence',
187
201
  name: 'presence',
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ENDPOINTS = void 0;
4
4
  // Generated by scripts/gen.mjs from openapi.json. Do not edit.
5
5
  exports.ENDPOINTS = {
6
+ "GET /health": "Check API health",
6
7
  "POST /v1/sessions": "Create session",
7
8
  "GET /v1/sessions": "List sessions",
8
9
  "DELETE /v1/sessions/{session}": "Delete session",
@@ -15,6 +16,10 @@ exports.ENDPOINTS = {
15
16
  "DELETE /v1/sessions/{session}/webhooks": "Delete session webhook",
16
17
  "GET /v1/{session}/auth/qr": "Get QR code",
17
18
  "POST /v1/{session}/auth/pairing-code": "Request pairing code",
19
+ "GET /v1/{session}/auth/passkey/challenge": "Get passkey challenge",
20
+ "POST /v1/{session}/auth/passkey": "Submit passkey assertion",
21
+ "GET /v1/{session}/auth/passkey/confirmation": "Get passkey confirmation code",
22
+ "POST /v1/{session}/auth/passkey/confirm": "Confirm passkey code",
18
23
  "POST /v1/sendText": "Send text message",
19
24
  "POST /v1/sendImage": "Send image",
20
25
  "POST /v1/sendFile": "Send file",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-whatsapp-retentionstack",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "n8n nodes for the WhatsApp Messaging API by Retention Stack. Send WhatsApp text, images, files and OTPs, and trigger workflows on incoming messages. No Meta approval needed.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",