Skip to content

Commit 1c3403b

Browse files
authored
(release): Release 2.0.0 of the JS SDK (#118)
* Update README.md * bump `package.json`
1 parent 4e705f9 commit 1c3403b

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,34 @@ The SDK contains typings and request builders for the Webflow Data API.
99

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

12+
## V2 Migration Guide
13+
14+
> 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.
15+
16+
#### Client Instantiation
17+
The SDK exports `WebflowClient` instead of `Webflow`. The client now takes `accessToken` instead of `token`.
18+
19+
```ts
20+
const webflow = new WebflowClient({ accessToken: "..." });
21+
```
22+
23+
#### Oauth
24+
The `WebflowClient` exports static methods that you can use for OAuth. These were previously on `Webflow`.
25+
26+
`webflow.authorizeUrl` -> `WebflowClient.authorizeURL`
27+
28+
`webflow.accessToken` -> `WebflowClient.getAccessToken`
29+
30+
`webflow.revokeToken` -> `WebflowClient.revokeToken`
31+
32+
#### HTTP Client
33+
The SDK no longer uses Axios and defaults to fetch. The SDK supports multiple runtimes and will handle
34+
using a fetch implementation if available or will default to `node-fetch`.
35+
36+
### Resources
37+
Previously the SDK only supported the most important resources, such as site and user. Now the SDK supports
38+
methods on a variety of different endpoints such as `collections`, `assets`, `forms`, `inventory`, `orders`, etc.
39+
1240
## Installation
1341

1442
Add this dependency to your project's package.json file:

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webflow-api",
3-
"version": "2.0.0-beta",
3+
"version": "2.0.0",
44
"private": false,
55
"repository": "https://github.com/webflow/js-webflow-api",
66
"main": "./index.js",
@@ -25,4 +25,4 @@
2525
"prettier": "2.7.1",
2626
"typescript": "4.6.4"
2727
}
28-
}
28+
}

0 commit comments

Comments
 (0)