Skip to content

Commit 88537ca

Browse files
committed
Update README to be consistent with clients
1 parent 6197ade commit 88537ca

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,9 @@ TOKEN=[TOKEN VALUE GOES HERE] node test.js
6060

6161
Take a look at [https://github.com/dnsimple/hello-domains-node](https://github.com/dnsimple/hello-domains-node) for an example app that authorizes via OAuth and displays your domain list.
6262

63-
## Pagination
64-
65-
There are helper submethods available on API methods that are paginated to assist with fetching items across all pages.
66-
67-
For an API that returns a `paginate` property, you can use either the `iterateAll` or `collectAll` submethods:
68-
69-
- **iterateAll**: return an asynchronous iterator of items that are returned from the API. When the last item on a page is iterated, the next page will be fetched. This continues until there are no more pages.
70-
71-
- **collectAll**: fetch all pages and collect all the items in order into an array.
72-
73-
Examples:
74-
75-
```typescript
76-
// iterateAll
77-
for await (const certificate of client.certificates.listCertificates.iterateAll(1010, "bingo.pizza")) {
78-
console.log(certificate);
79-
}
80-
// collectAll
81-
const certificates: Array<Certificate> = await client.certificates.listCertificates.collectAll(1010, "bingo.pizza");
82-
console.log(certificates.length);
83-
```
63+
## Configuration
8464

85-
## Sandbox Environment
65+
### Sandbox Environment
8666

8767
We highly recommend testing against our [sandbox environment](https://developer.dnsimple.com/sandbox/) before using our production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the chance of your running up against rate limits.
8868

@@ -98,7 +78,7 @@ const client = new DNSimple({
9878

9979
You will need to ensure that you are using an access token created in the sandbox environment. Production tokens will *not* work in the sandbox environment.
10080

101-
## Setting a custom `User-Agent` header
81+
### Setting a custom `User-Agent` header
10282

10383
You customize the `User-Agent` header for the calls made to the DNSimple API:
10484

@@ -112,6 +92,27 @@ const client = new DNSimple({
11292

11393
The value you provide will be appended to the default `User-Agent` the client uses. For example, if you use `my-app`, the final header value will be `dnsimple-node/x.x.x my-app` (note that it will vary depending on the client version).
11494

95+
## Pagination
96+
97+
There are helper submethods available on API methods that are paginated to assist with fetching items across all pages.
98+
99+
For an API that returns a `paginate` property, you can use either the `iterateAll` or `collectAll` submethods:
100+
101+
- **iterateAll**: return an asynchronous iterator of items that are returned from the API. When the last item on a page is iterated, the next page will be fetched. This continues until there are no more pages.
102+
103+
- **collectAll**: fetch all pages and collect all the items in order into an array.
104+
105+
Examples:
106+
107+
```typescript
108+
// iterateAll
109+
for await (const certificate of client.certificates.listCertificates.iterateAll(1010, "bingo.pizza")) {
110+
console.log(certificate);
111+
}
112+
// collectAll
113+
const certificates: Array<Certificate> = await client.certificates.listCertificates.collectAll(1010, "bingo.pizza");
114+
console.log(certificates.length);
115+
```
115116

116117
## Contributing
117118

0 commit comments

Comments
 (0)