You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-1Lines changed: 50 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,48 @@ A complete Nodejs wrapper for the Drip REST API.
8
8
9
9
`npm install drip-nodejs --save`
10
10
11
+
## NOTE: Potential Breaking Changes for Version 3.0.0
12
+
13
+
Drip's documentation doesn't explicitly describe the required schema for each endpoint. In versions prior to 3 you would need to explicitly pass payloads with the required schema, which aren't obvious. In version 3 and later, I've attempted to make this a bit simpler. For example, batch endpoints will now only need you to pass an array of objects as:
14
+
15
+
```js
16
+
payload = [
17
+
{
18
+
email:'user@example.com',
19
+
action:'Purchased'
20
+
},
21
+
{
22
+
email:'user@example.com',
23
+
action:'Purchased'
24
+
}
25
+
]
26
+
// client.recordBatchEvents(payload, ...)
27
+
```
28
+
29
+
Prior to v3 changes you would need to do something like the following where the entire payload structure is defined:
30
+
31
+
```js
32
+
payload = {
33
+
batches: [
34
+
{
35
+
events: [
36
+
{
37
+
email:'user@example.com',
38
+
action:'Purchased'
39
+
},
40
+
{
41
+
email:'user@example.com',
42
+
action:'Purchased'
43
+
}
44
+
]
45
+
}
46
+
]
47
+
}
48
+
// client.recordBatchEvents(payload, ...)
49
+
```
50
+
51
+
This should help to get up and running simpler without much knowledge of the required schema. **However, existing users will need to take special note of these changes**.
52
+
11
53
## Authentication
12
54
13
55
For private use and integrations, use your API Token found [here](https://www.getdrip.com/user/edit). Create a new instance of the client library with:
@@ -32,7 +74,7 @@ The following methods are currently available on the client instance. You can fi
32
74
| List all accounts |`client.listAccounts(callback)`|
33
75
| Fetch an account |`client.fetchAccount(accountId, callback)`|
0 commit comments