Skip to content

Commit

Permalink
minor consistency improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dpim committed Jan 6, 2024
1 parent 0ac077f commit 79a9b88
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,33 +83,33 @@ const accessToken = WebflowClient.getAccessToken(
Instantiate the client using your `access_token`.

```javascript
import { WebflowClient } from "webflow-api"
import { WebflowClient } from "webflow-api";

const webflow = WebflowClient({ accessToken })
const webflow = WebflowClient({ accessToken });
```

## Webflow Types

All of the types are nested within the `Webflow` module. Let IntelliSense
All of the types are nested within the `Webflow` object. Let IntelliSense
guide you!

## Exception Handling

All errors thrown by the SDK will be subclasses of [`WebflowError`](./src/errors/WebflowError.ts).

```javascript
import { WebflowClient, Webflow } from 'webflow'
const webflow = new WebflowClient({ accessToken: 'your_access_token' })
import { WebflowClient, Webflow } from 'webflow';
const webflow = new WebflowClient({ accessToken: 'your_access_token' });

try {
webflow.sites.get(...)
const sites = await webflow.sites.get(...);
} catch (e) {
if (e instanceof Webflow.ForbiddenError) {
console.log(e.body.message)
console.log(e.body.message);
} else if (e instanceof Webflow.BadRequestError) {
console.log(e.body.message)
console.log(e.body.message);
} else {
throw e
throw e;
}
}
```
Expand All @@ -121,15 +121,15 @@ try {
By default, requests time out after 60 seconds. You can configure the timeout and # of max retries

```javascript
import { WebflowClient } from 'webflow'
import { WebflowClient } from 'webflow';

const webflow = new WebflowClient({
accessToken: 'your_access_token',
requestOptions: {
timeoutInSeconds: 10,
maxRetries: 3,
}
})
});
```

## Beta Status
Expand Down

0 comments on commit 79a9b88

Please sign in to comment.