From 1c3403bcc32c65bd1fe7c14125fb5f7c06b0545f Mon Sep 17 00:00:00 2001 From: fern <126544928+fern-bot@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:35:22 -0800 Subject: [PATCH] (release): Release 2.0.0 of the JS SDK (#118) * Update README.md * bump `package.json` --- README.md | 28 ++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19adf57..cf109b4 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/package.json b/package.json index d9c1fd1..df57177 100644 --- a/package.json +++ b/package.json @@ -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", @@ -25,4 +25,4 @@ "prettier": "2.7.1", "typescript": "4.6.4" } -} \ No newline at end of file +}