n8n-nodes-amplitude 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 +46 -0
- package/README.md +325 -0
- package/dist/credentials/AmplitudeApi.credentials.d.ts +10 -0
- package/dist/credentials/AmplitudeApi.credentials.d.ts.map +1 -0
- package/dist/credentials/AmplitudeApi.credentials.js +81 -0
- package/dist/credentials/AmplitudeApi.credentials.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/Amplitude/Amplitude.node.d.ts +6 -0
- package/dist/nodes/Amplitude/Amplitude.node.d.ts.map +1 -0
- package/dist/nodes/Amplitude/Amplitude.node.js +697 -0
- package/dist/nodes/Amplitude/Amplitude.node.js.map +1 -0
- package/dist/nodes/Amplitude/GenericFunctions.d.ts +47 -0
- package/dist/nodes/Amplitude/GenericFunctions.d.ts.map +1 -0
- package/dist/nodes/Amplitude/GenericFunctions.js +296 -0
- package/dist/nodes/Amplitude/GenericFunctions.js.map +1 -0
- package/dist/nodes/Amplitude/amplitude.svg +13 -0
- package/dist/nodes/Amplitude/descriptions/CohortDescription.d.ts +4 -0
- package/dist/nodes/Amplitude/descriptions/CohortDescription.d.ts.map +1 -0
- package/dist/nodes/Amplitude/descriptions/CohortDescription.js +269 -0
- package/dist/nodes/Amplitude/descriptions/CohortDescription.js.map +1 -0
- package/dist/nodes/Amplitude/descriptions/DashboardDescription.d.ts +4 -0
- package/dist/nodes/Amplitude/descriptions/DashboardDescription.d.ts.map +1 -0
- package/dist/nodes/Amplitude/descriptions/DashboardDescription.js +509 -0
- package/dist/nodes/Amplitude/descriptions/DashboardDescription.js.map +1 -0
- package/dist/nodes/Amplitude/descriptions/EventDescription.d.ts +4 -0
- package/dist/nodes/Amplitude/descriptions/EventDescription.d.ts.map +1 -0
- package/dist/nodes/Amplitude/descriptions/EventDescription.js +504 -0
- package/dist/nodes/Amplitude/descriptions/EventDescription.js.map +1 -0
- package/dist/nodes/Amplitude/descriptions/ExportDescription.d.ts +4 -0
- package/dist/nodes/Amplitude/descriptions/ExportDescription.d.ts.map +1 -0
- package/dist/nodes/Amplitude/descriptions/ExportDescription.js +131 -0
- package/dist/nodes/Amplitude/descriptions/ExportDescription.js.map +1 -0
- package/dist/nodes/Amplitude/descriptions/TaxonomyDescription.d.ts +4 -0
- package/dist/nodes/Amplitude/descriptions/TaxonomyDescription.d.ts.map +1 -0
- package/dist/nodes/Amplitude/descriptions/TaxonomyDescription.js +342 -0
- package/dist/nodes/Amplitude/descriptions/TaxonomyDescription.js.map +1 -0
- package/dist/nodes/Amplitude/descriptions/UserDescription.d.ts +4 -0
- package/dist/nodes/Amplitude/descriptions/UserDescription.d.ts.map +1 -0
- package/dist/nodes/Amplitude/descriptions/UserDescription.js +251 -0
- package/dist/nodes/Amplitude/descriptions/UserDescription.js.map +1 -0
- package/dist/nodes/Amplitude/types/AmplitudeTypes.d.ts +197 -0
- package/dist/nodes/Amplitude/types/AmplitudeTypes.d.ts.map +1 -0
- package/dist/nodes/Amplitude/types/AmplitudeTypes.js +9 -0
- package/dist/nodes/Amplitude/types/AmplitudeTypes.js.map +1 -0
- package/package.json +84 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2017 MariaDB Corporation Ab.
|
|
4
|
+
|
|
5
|
+
Licensor:
|
|
6
|
+
Velocity BPA, LLC
|
|
7
|
+
https://velobpa.com
|
|
8
|
+
|
|
9
|
+
Licensed Work:
|
|
10
|
+
This repository and all source code, documentation, and associated artifacts
|
|
11
|
+
contained herein, including all n8n community nodes published by Velocity BPA.
|
|
12
|
+
|
|
13
|
+
Additional Use Grant:
|
|
14
|
+
You may use, modify, and run the Licensed Work free of charge for:
|
|
15
|
+
- Personal use
|
|
16
|
+
- Educational use
|
|
17
|
+
- Research use
|
|
18
|
+
- Internal business use, provided such use does not involve resale,
|
|
19
|
+
redistribution, or offering the Licensed Work as part of a commercial
|
|
20
|
+
product or service.
|
|
21
|
+
|
|
22
|
+
Commercial Use Restriction:
|
|
23
|
+
Commercial Use of the Licensed Work is prohibited without a valid
|
|
24
|
+
Commercial License issued by the Licensor.
|
|
25
|
+
|
|
26
|
+
Commercial Use includes, but is not limited to:
|
|
27
|
+
- Use of the Licensed Work within any Software-as-a-Service (SaaS),
|
|
28
|
+
Platform-as-a-Service (PaaS), or hosted application that is sold,
|
|
29
|
+
licensed, or monetized in any form
|
|
30
|
+
- Offering the Licensed Work as part of a managed services engagement
|
|
31
|
+
- Bundling or redistributing the Licensed Work with a paid product
|
|
32
|
+
- Reselling, sublicensing, or white-labeling the Licensed Work
|
|
33
|
+
- Embedding the Licensed Work into any commercial automation platform,
|
|
34
|
+
integration product, or solution offering
|
|
35
|
+
|
|
36
|
+
Change Date:
|
|
37
|
+
January 1, 2030
|
|
38
|
+
|
|
39
|
+
Change License:
|
|
40
|
+
Apache License, Version 2.0
|
|
41
|
+
|
|
42
|
+
For commercial licensing inquiries:
|
|
43
|
+
licensing@velobpa.com
|
|
44
|
+
|
|
45
|
+
Business Source License 1.1 full text:
|
|
46
|
+
https://mariadb.com/bsl11/
|
package/README.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# n8n-nodes-amplitude
|
|
2
|
+
|
|
3
|
+
> **[Velocity BPA Licensing Notice]**
|
|
4
|
+
>
|
|
5
|
+
> This n8n node is licensed under the Business Source License 1.1 (BSL 1.1).
|
|
6
|
+
>
|
|
7
|
+
> Use of this node by for-profit organizations in production environments requires a commercial license from Velocity BPA.
|
|
8
|
+
>
|
|
9
|
+
> For licensing information, visit https://velobpa.com/licensing or contact licensing@velobpa.com.
|
|
10
|
+
|
|
11
|
+
A comprehensive n8n community node for Amplitude, the leading product analytics platform. This node enables workflow automation for event tracking, user analytics, cohort management, taxonomy management, and data export.
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **Event Tracking**: Send single events, batch events, identify users, group identify, and track revenue
|
|
21
|
+
- **Dashboard Queries**: Event segmentation, funnel analysis, retention analysis, user sessions, user composition
|
|
22
|
+
- **Taxonomy Management**: Manage event types, event properties, user properties, and group properties
|
|
23
|
+
- **Cohort Management**: Create, read, update, delete, and download cohort members
|
|
24
|
+
- **User Management**: Search users, get activity streams, manage user properties
|
|
25
|
+
- **Data Export**: Export raw events and user data for GDPR/CCPA compliance
|
|
26
|
+
- **Multi-Region Support**: US and EU data center support
|
|
27
|
+
- **Rate Limit Handling**: Automatic retry with exponential backoff
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
### Community Nodes (Recommended)
|
|
32
|
+
|
|
33
|
+
1. Open your n8n instance
|
|
34
|
+
2. Go to **Settings** → **Community Nodes**
|
|
35
|
+
3. Click **Install a community node**
|
|
36
|
+
4. Enter `n8n-nodes-amplitude`
|
|
37
|
+
5. Click **Install**
|
|
38
|
+
|
|
39
|
+
### Manual Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Navigate to your n8n installation directory
|
|
43
|
+
cd ~/.n8n
|
|
44
|
+
|
|
45
|
+
# Install the package
|
|
46
|
+
npm install n8n-nodes-amplitude
|
|
47
|
+
|
|
48
|
+
# Restart n8n
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Development Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Clone the repository
|
|
55
|
+
git clone https://github.com/Velocity-BPA/n8n-nodes-amplitude.git
|
|
56
|
+
cd n8n-nodes-amplitude
|
|
57
|
+
|
|
58
|
+
# Install dependencies
|
|
59
|
+
npm install
|
|
60
|
+
|
|
61
|
+
# Build the project
|
|
62
|
+
npm run build
|
|
63
|
+
|
|
64
|
+
# Create symlink to n8n custom nodes directory
|
|
65
|
+
mkdir -p ~/.n8n/custom
|
|
66
|
+
ln -s $(pwd) ~/.n8n/custom/n8n-nodes-amplitude
|
|
67
|
+
|
|
68
|
+
# Restart n8n
|
|
69
|
+
n8n start
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Credentials Setup
|
|
73
|
+
|
|
74
|
+
| Field | Description | Required |
|
|
75
|
+
|-------|-------------|----------|
|
|
76
|
+
| API Key | Your Amplitude API Key | Yes |
|
|
77
|
+
| Secret Key | Your Amplitude Secret Key | Yes |
|
|
78
|
+
| Region | Data center region (US or EU) | Yes |
|
|
79
|
+
|
|
80
|
+
### Finding Your Credentials
|
|
81
|
+
|
|
82
|
+
1. Log in to Amplitude
|
|
83
|
+
2. Go to **Settings** → **Projects**
|
|
84
|
+
3. Select your project
|
|
85
|
+
4. Copy the **API Key** and **Secret Key**
|
|
86
|
+
|
|
87
|
+
## Resources & Operations
|
|
88
|
+
|
|
89
|
+
### Event Resource
|
|
90
|
+
|
|
91
|
+
| Operation | Description |
|
|
92
|
+
|-----------|-------------|
|
|
93
|
+
| Send | Send a single event to Amplitude |
|
|
94
|
+
| Send Batch | Send multiple events in a batch (up to 10 recommended) |
|
|
95
|
+
| Identify | Set user properties |
|
|
96
|
+
| Group Identify | Set group properties |
|
|
97
|
+
| Revenue | Track a revenue event |
|
|
98
|
+
|
|
99
|
+
### Dashboard Resource
|
|
100
|
+
|
|
101
|
+
| Operation | Description |
|
|
102
|
+
|-----------|-------------|
|
|
103
|
+
| Event Segmentation | Analyze event trends and metrics |
|
|
104
|
+
| Funnel Analysis | Analyze conversion funnels |
|
|
105
|
+
| Retention Analysis | Analyze user retention |
|
|
106
|
+
| User Sessions | Analyze user session data |
|
|
107
|
+
| User Composition | Analyze user breakdown by properties |
|
|
108
|
+
| Event List | List events for a specific user |
|
|
109
|
+
| Export Chart | Export chart data from a saved chart |
|
|
110
|
+
| Get Data Tables | Get available data tables |
|
|
111
|
+
|
|
112
|
+
### Taxonomy Resource
|
|
113
|
+
|
|
114
|
+
| Operation | Description |
|
|
115
|
+
|-----------|-------------|
|
|
116
|
+
| Get Event Types | List all event types |
|
|
117
|
+
| Create Event Type | Create a new event type |
|
|
118
|
+
| Update Event Type | Update an existing event type |
|
|
119
|
+
| Delete Event Type | Delete an event type |
|
|
120
|
+
| Get Event Properties | List properties for an event type |
|
|
121
|
+
| Create Event Property | Create a new event property |
|
|
122
|
+
| Get User Properties | List all user properties |
|
|
123
|
+
| Create User Property | Create a new user property |
|
|
124
|
+
| Get Group Properties | List properties for a group type |
|
|
125
|
+
|
|
126
|
+
### Cohort Resource
|
|
127
|
+
|
|
128
|
+
| Operation | Description |
|
|
129
|
+
|-----------|-------------|
|
|
130
|
+
| Create | Create a new cohort |
|
|
131
|
+
| Get | Get a cohort by ID |
|
|
132
|
+
| Get Many | Get all cohorts |
|
|
133
|
+
| Update | Update a cohort |
|
|
134
|
+
| Delete | Delete a cohort |
|
|
135
|
+
| Download | Download cohort members |
|
|
136
|
+
|
|
137
|
+
### User Resource
|
|
138
|
+
|
|
139
|
+
| Operation | Description |
|
|
140
|
+
|-----------|-------------|
|
|
141
|
+
| Search | Search for users by user ID or Amplitude ID |
|
|
142
|
+
| Get Activity | Get user activity stream |
|
|
143
|
+
| Get User Properties | Get properties for a user |
|
|
144
|
+
| Update User Properties | Update properties for a user |
|
|
145
|
+
|
|
146
|
+
### Export Resource
|
|
147
|
+
|
|
148
|
+
| Operation | Description |
|
|
149
|
+
|-----------|-------------|
|
|
150
|
+
| Export Events | Export raw event data |
|
|
151
|
+
| Export User Data | Export user data for GDPR/CCPA compliance |
|
|
152
|
+
|
|
153
|
+
## Usage Examples
|
|
154
|
+
|
|
155
|
+
### Send an Event
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
// Event parameters
|
|
159
|
+
{
|
|
160
|
+
"eventType": "Button Clicked",
|
|
161
|
+
"userId": "user_12345",
|
|
162
|
+
"eventProperties": {
|
|
163
|
+
"button_name": "signup",
|
|
164
|
+
"page": "homepage"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Identify a User
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
// Identify parameters
|
|
173
|
+
{
|
|
174
|
+
"userId": "user_12345",
|
|
175
|
+
"userProperties": {
|
|
176
|
+
"plan": "premium",
|
|
177
|
+
"company": "Acme Inc"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Run Event Segmentation
|
|
183
|
+
|
|
184
|
+
```javascript
|
|
185
|
+
// Event segmentation parameters
|
|
186
|
+
{
|
|
187
|
+
"eventType": "Purchase Completed",
|
|
188
|
+
"startDate": "2024-01-01",
|
|
189
|
+
"endDate": "2024-01-31",
|
|
190
|
+
"metric": "uniques",
|
|
191
|
+
"interval": "1"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Create a Cohort
|
|
196
|
+
|
|
197
|
+
```javascript
|
|
198
|
+
// Cohort creation parameters
|
|
199
|
+
{
|
|
200
|
+
"cohortName": "Power Users",
|
|
201
|
+
"definition": {
|
|
202
|
+
"operator": "AND",
|
|
203
|
+
"conditions": [
|
|
204
|
+
{
|
|
205
|
+
"event_type": "Login",
|
|
206
|
+
"count_operator": ">=",
|
|
207
|
+
"count_value": 10
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Amplitude Concepts
|
|
215
|
+
|
|
216
|
+
### Events
|
|
217
|
+
Events are user actions tracked in Amplitude. Each event has a type, user identifier, and optional properties.
|
|
218
|
+
|
|
219
|
+
### User Properties
|
|
220
|
+
User properties are attributes associated with a user that persist across events (e.g., plan type, company name).
|
|
221
|
+
|
|
222
|
+
### Cohorts
|
|
223
|
+
Cohorts are groups of users defined by behavioral or property conditions.
|
|
224
|
+
|
|
225
|
+
### Taxonomy
|
|
226
|
+
The taxonomy defines the schema for your events and properties, helping maintain data quality.
|
|
227
|
+
|
|
228
|
+
## Rate Limits
|
|
229
|
+
|
|
230
|
+
| API | Limit |
|
|
231
|
+
|-----|-------|
|
|
232
|
+
| HTTP V2 (Events) | 100 batches/sec, 1000 events/sec (Starter) |
|
|
233
|
+
| Dashboard | 5 concurrent requests, 108K cost/hour |
|
|
234
|
+
| User Property Updates | 1800/hour per user |
|
|
235
|
+
|
|
236
|
+
This node automatically handles rate limits with exponential backoff.
|
|
237
|
+
|
|
238
|
+
## Error Handling
|
|
239
|
+
|
|
240
|
+
The node includes comprehensive error handling:
|
|
241
|
+
|
|
242
|
+
- **Rate Limiting**: Automatic retry with exponential backoff
|
|
243
|
+
- **Server Errors**: Automatic retry up to 3 times
|
|
244
|
+
- **Validation Errors**: Clear error messages for invalid parameters
|
|
245
|
+
- **Continue on Fail**: Option to continue workflow on errors
|
|
246
|
+
|
|
247
|
+
## Security Best Practices
|
|
248
|
+
|
|
249
|
+
1. **Store credentials securely**: Use n8n's credential management
|
|
250
|
+
2. **Use appropriate scopes**: Only request necessary permissions
|
|
251
|
+
3. **Monitor API usage**: Keep track of API calls to avoid rate limits
|
|
252
|
+
4. **Validate user input**: Ensure user/device IDs meet minimum length requirements (5 characters)
|
|
253
|
+
|
|
254
|
+
## Development
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Install dependencies
|
|
258
|
+
npm install
|
|
259
|
+
|
|
260
|
+
# Build the project
|
|
261
|
+
npm run build
|
|
262
|
+
|
|
263
|
+
# Run linting
|
|
264
|
+
npm run lint
|
|
265
|
+
|
|
266
|
+
# Fix linting issues
|
|
267
|
+
npm run lint:fix
|
|
268
|
+
|
|
269
|
+
# Run tests
|
|
270
|
+
npm test
|
|
271
|
+
|
|
272
|
+
# Run tests with coverage
|
|
273
|
+
npm run test:coverage
|
|
274
|
+
|
|
275
|
+
# Watch mode for development
|
|
276
|
+
npm run dev
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Author
|
|
280
|
+
|
|
281
|
+
**Velocity BPA**
|
|
282
|
+
- Website: [velobpa.com](https://velobpa.com)
|
|
283
|
+
- GitHub: [Velocity-BPA](https://github.com/Velocity-BPA)
|
|
284
|
+
|
|
285
|
+
## Licensing
|
|
286
|
+
|
|
287
|
+
This n8n community node is licensed under the **Business Source License 1.1**.
|
|
288
|
+
|
|
289
|
+
### Free Use
|
|
290
|
+
Permitted for personal, educational, research, and internal business use.
|
|
291
|
+
|
|
292
|
+
### Commercial Use
|
|
293
|
+
Use of this node within any SaaS, PaaS, hosted platform, managed service, or paid automation offering requires a commercial license.
|
|
294
|
+
|
|
295
|
+
For licensing inquiries:
|
|
296
|
+
**licensing@velobpa.com**
|
|
297
|
+
|
|
298
|
+
See [LICENSE](LICENSE), [COMMERCIAL_LICENSE.md](COMMERCIAL_LICENSE.md), and [LICENSING_FAQ.md](LICENSING_FAQ.md) for details.
|
|
299
|
+
|
|
300
|
+
## Contributing
|
|
301
|
+
|
|
302
|
+
Contributions are welcome! Please follow these steps:
|
|
303
|
+
|
|
304
|
+
1. Fork the repository
|
|
305
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
306
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
307
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
308
|
+
5. Open a Pull Request
|
|
309
|
+
|
|
310
|
+
Please ensure:
|
|
311
|
+
- All tests pass
|
|
312
|
+
- Code follows the existing style
|
|
313
|
+
- Documentation is updated
|
|
314
|
+
|
|
315
|
+
## Support
|
|
316
|
+
|
|
317
|
+
- **Documentation**: [Amplitude API Docs](https://www.docs.developers.amplitude.com/)
|
|
318
|
+
- **Issues**: [GitHub Issues](https://github.com/Velocity-BPA/n8n-nodes-amplitude/issues)
|
|
319
|
+
- **n8n Community**: [n8n Community Forum](https://community.n8n.io/)
|
|
320
|
+
|
|
321
|
+
## Acknowledgments
|
|
322
|
+
|
|
323
|
+
- [Amplitude](https://amplitude.com/) for their comprehensive analytics platform and API
|
|
324
|
+
- [n8n](https://n8n.io/) for the excellent workflow automation platform
|
|
325
|
+
- The n8n community for inspiration and best practices
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class AmplitudeApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AmplitudeApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmplitudeApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/AmplitudeApi.credentials.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,YAAa,YAAW,eAAe;IACnD,IAAI,SAAkB;IACtB,WAAW,SAAmB;IAC9B,gBAAgB,SAAgD;IAChE,UAAU,EAAE,eAAe,EAAE,CAsC3B;IAEF,YAAY,EAAE,oBAAoB,CAGhC;IAEF,IAAI,EAAE,sBAAsB,CAmB1B;CACF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AmplitudeApi = void 0;
|
|
10
|
+
class AmplitudeApi {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'amplitudeApi';
|
|
13
|
+
this.displayName = 'Amplitude API';
|
|
14
|
+
this.documentationUrl = 'https://www.docs.developers.amplitude.com/';
|
|
15
|
+
this.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'API Key',
|
|
18
|
+
name: 'apiKey',
|
|
19
|
+
type: 'string',
|
|
20
|
+
typeOptions: { password: true },
|
|
21
|
+
default: '',
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'Your Amplitude API Key. Found in Amplitude under Settings > Projects > Your Project.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'Secret Key',
|
|
27
|
+
name: 'secretKey',
|
|
28
|
+
type: 'string',
|
|
29
|
+
typeOptions: { password: true },
|
|
30
|
+
default: '',
|
|
31
|
+
required: true,
|
|
32
|
+
description: 'Your Amplitude Secret Key. Required for Dashboard API access.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Region',
|
|
36
|
+
name: 'region',
|
|
37
|
+
type: 'options',
|
|
38
|
+
options: [
|
|
39
|
+
{
|
|
40
|
+
name: 'US',
|
|
41
|
+
value: 'us',
|
|
42
|
+
description: 'United States data center',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'EU',
|
|
46
|
+
value: 'eu',
|
|
47
|
+
description: 'European Union data center',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
default: 'us',
|
|
51
|
+
description: 'The Amplitude data center region for your project',
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
this.authenticate = {
|
|
55
|
+
type: 'generic',
|
|
56
|
+
properties: {},
|
|
57
|
+
};
|
|
58
|
+
this.test = {
|
|
59
|
+
request: {
|
|
60
|
+
baseURL: '={{$credentials.region === "eu" ? "https://api.eu.amplitude.com" : "https://api2.amplitude.com"}}',
|
|
61
|
+
url: '/2/httpapi',
|
|
62
|
+
method: 'POST',
|
|
63
|
+
headers: {
|
|
64
|
+
'Content-Type': 'application/json',
|
|
65
|
+
},
|
|
66
|
+
body: JSON.stringify({
|
|
67
|
+
api_key: '={{$credentials.apiKey}}',
|
|
68
|
+
events: [
|
|
69
|
+
{
|
|
70
|
+
user_id: 'n8n_credential_test',
|
|
71
|
+
event_type: 'n8n_credential_test',
|
|
72
|
+
time: Date.now(),
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.AmplitudeApi = AmplitudeApi;
|
|
81
|
+
//# sourceMappingURL=AmplitudeApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmplitudeApi.credentials.js","sourceRoot":"","sources":["../../credentials/AmplitudeApi.credentials.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AASH,MAAa,YAAY;IAAzB;QACC,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,eAAe,CAAC;QAC9B,qBAAgB,GAAG,4CAA4C,CAAC;QAChE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,sFAAsF;aACnG;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,+DAA+D;aAC5E;YACD;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,IAAI;wBACX,WAAW,EAAE,2BAA2B;qBACxC;oBACD;wBACC,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,IAAI;wBACX,WAAW,EAAE,4BAA4B;qBACzC;iBACD;gBACD,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,mDAAmD;aAChE;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,mGAAmG;gBAC5G,GAAG,EAAE,YAAY;gBACjB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACR,cAAc,EAAE,kBAAkB;iBAClC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACpB,OAAO,EAAE,0BAA0B;oBACnC,MAAM,EAAE;wBACP;4BACC,OAAO,EAAE,qBAAqB;4BAC9B,UAAU,EAAE,qBAAqB;4BACjC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;yBAChB;qBACD;iBACD,CAAC;aACF;SACD,CAAC;IACH,CAAC;CAAA;AArED,oCAqEC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAOA,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./credentials/AmplitudeApi.credentials"), exports);
|
|
24
|
+
__exportStar(require("./nodes/Amplitude/Amplitude.node"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yEAAuD;AACvD,mEAAiD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class Amplitude implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=Amplitude.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Amplitude.node.d.ts","sourceRoot":"","sources":["../../../nodes/Amplitude/Amplitude.node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAsCtB,qBAAa,SAAU,YAAW,SAAS;IAC1C,WAAW,EAAE,oBAAoB,CAwE/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAm0BvE"}
|