Skip to content

Commit

Permalink
(release): Release 2.0.0 of the JS SDK (#118)
Browse files Browse the repository at this point in the history
* Update README.md

* bump `package.json`
  • Loading branch information
fern-support authored Feb 22, 2024
1 parent 4e705f9 commit 1c3403b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ The SDK contains typings and request builders for the Webflow Data API.

Explore the [API reference documentation](https://developers.webflow.com/reference/rest-introduction).

## V2 Migration Guide

> The SDK was rewritten in V2 and is now programatically generated from our OpenAPI spec. As part of this release there are some breaking changes.
#### Client Instantiation
The SDK exports `WebflowClient` instead of `Webflow`. The client now takes `accessToken` instead of `token`.

```ts
const webflow = new WebflowClient({ accessToken: "..." });
```

#### Oauth
The `WebflowClient` exports static methods that you can use for OAuth. These were previously on `Webflow`.

`webflow.authorizeUrl` -> `WebflowClient.authorizeURL`

`webflow.accessToken` -> `WebflowClient.getAccessToken`

`webflow.revokeToken` -> `WebflowClient.revokeToken`

#### HTTP Client
The SDK no longer uses Axios and defaults to fetch. The SDK supports multiple runtimes and will handle
using a fetch implementation if available or will default to `node-fetch`.

### Resources
Previously the SDK only supported the most important resources, such as site and user. Now the SDK supports
methods on a variety of different endpoints such as `collections`, `assets`, `forms`, `inventory`, `orders`, etc.

## Installation

Add this dependency to your project's package.json file:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webflow-api",
"version": "2.0.0-beta",
"version": "2.0.0",
"private": false,
"repository": "https://github.com/webflow/js-webflow-api",
"main": "./index.js",
Expand All @@ -25,4 +25,4 @@
"prettier": "2.7.1",
"typescript": "4.6.4"
}
}
}

0 comments on commit 1c3403b

Please sign in to comment.