Skip to content

Commit 0f123f0

Browse files
committed
fix readme + set user agent
1 parent 3338204 commit 0f123f0

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,21 @@ client.events.create({
157157
## Counts
158158

159159
```node
160-
client.appCounts(callback);
160+
client.counts.appCounts(callback);
161161

162-
client.conversationCounts(callback);
162+
client.counts.conversationCounts(callback);
163163

164-
client.conversationAdminCounts(callback);
164+
client.counts.conversationAdminCounts(callback);
165165

166-
client.userTagCounts(callback);
166+
client.counts.userTagCounts(callback);
167167

168-
client.userSegmentCounts(callback);
168+
client.counts.userSegmentCounts(callback);
169169

170-
client.companyTagCounts(callback);
170+
client.counts.companyTagCounts(callback);
171171

172-
client.companySegmentCounts(callback);
172+
client.counts.companySegmentCounts(callback);
173173

174-
client.companyUserCounts(callback);
174+
client.counts.companyUserCounts(callback);
175175
```
176176

177177
## Pagination

lib/client.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class Client {
2020
.auth(this.appId, this.appApiKey)
2121
.type('json')
2222
.header('Accept', 'application/json')
23+
.header('User-Agent', 'intercom-client')
2324
.end(r => f(r.status));
2425
}
2526
post(endpoint, data, f) {
@@ -28,6 +29,7 @@ export class Client {
2829
.type('json')
2930
.send(data)
3031
.header('Accept', 'application/json')
32+
.header('User-Agent', 'intercom-client')
3133
.end(r => f(r));
3234
}
3335
get(endpoint, data, f) {
@@ -36,13 +38,15 @@ export class Client {
3638
.type('json')
3739
.query(data)
3840
.header('Accept', 'application/json')
41+
.header('User-Agent', 'intercom-client')
3942
.end(r => f(r));
4043
}
4144
nextPage(paginationObject, f) {
4245
unirest.get(paginationObject.next)
4346
.auth(this.appId, this.appApiKey)
4447
.type('json')
4548
.header('Accept', 'application/json')
49+
.header('User-Agent', 'intercom-client')
4650
.end(r => f(r));
4751
}
4852
delete(endpoint, data, f) {
@@ -51,6 +55,7 @@ export class Client {
5155
.type('json')
5256
.query(data)
5357
.header('Accept', 'application/json')
58+
.header('User-Agent', 'intercom-client')
5459
.end(r => f(r));
5560
}
5661
}

0 commit comments

Comments
 (0)