Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Update SDK docs for Hosted Bundle (#63069)

Timofey Kachalov32f47019f070
diff --git a/docs/embedding/sdk/introduction.md b/docs/embedding/sdk/introduction.md
index ba66c2e291b..a95e23ff9f5 100644
--- a/docs/embedding/sdk/introduction.md
+++ b/docs/embedding/sdk/introduction.md
@@ -40,16 +40,16 @@ Enable the Embedded analytics SDK by going to **Admin settings > Settings > Embe
### Install the SDK in your React application
-You can install the Embedded analytics SDK for React via npm. Make sure to use the dist-tag that corresponds to your Metabase version, example: 53-stable for Metabase 53:
+You can install the Embedded analytics SDK for React via npm. Make sure to use the dist-tag that corresponds to your Metabase version, example: 56-stable for Metabase 56:
```bash
-npm install @metabase/embedding-sdk-react@53-stable
+npm install @metabase/embedding-sdk-react@56-stable
```
-or with yarn:
+or with Yarn:
```bash
-yarn add @metabase/embedding-sdk-react@53-stable
+yarn add @metabase/embedding-sdk-react@56-stable
```
### Resolving `@types/react` version mismatches
@@ -58,7 +58,7 @@ In rare scenarios, the Embedding SDK and your application may use different majo
To enforce a single `@types/react` version across all dependencies, add an `overrides` (npm) or `resolutions` (Yarn) section to your `package.json` and specify the `@types/react` version your application uses.
-#### NPM set @types/react version
+#### npm set @types/react version
```json
{
@@ -78,6 +78,13 @@ To enforce a single `@types/react` version across all dependencies, add an `over
}
```
+## Architecture
+
+Starting with Metabase 57, the SDK consists of two parts:
+
+- **SDK Package** – The `@metabase/embedding-sdk-react` npm package is a lightweight bootstrapper library. Its primary purpose is to load and run the main SDK Bundle code.
+- **SDK Bundle** – The full SDK code, served directly from your self-hosted Metabase instance or Metabase Cloud, and it's the part of the Metabase. This ensures that the main SDK code is always compatible with its corresponding Metabase instance.
+
## Developing with the Embedded analytics SDK
Start with one of the quickstarts, then see these pages for more info on components, theming, and more.
@@ -106,9 +113,9 @@ View the SDK's changelog:
- [53-stable](https://github.com/metabase/metabase/blob/release-x.53.x/enterprise/frontend/src/embedding-sdk/CHANGELOG.md)
- [52-stable](https://github.com/metabase/metabase/blob/release-x.52.x/enterprise/frontend/src/embedding-sdk/CHANGELOG.md)
-## Embedded analytics SDK on NPM
+## Embedded analytics SDK on npm
-Check out the Metabase Embedded analytics SDK on NPM: [metaba.se/sdk-npm](https://metaba.se/sdk-npm).
+Check out the Metabase Embedded analytics SDK on npm: [metaba.se/sdk-npm](https://metaba.se/sdk-npm).
## SDK limitations
diff --git a/docs/embedding/sdk/quickstart.md b/docs/embedding/sdk/quickstart.md
index 9459c5bafd3..6a304f7880b 100644
--- a/docs/embedding/sdk/quickstart.md
+++ b/docs/embedding/sdk/quickstart.md
@@ -47,9 +47,9 @@ Still in the Admin's Settings tab, navigate to the **Authentication** section in
## 3. Install the SDK in your app
-When installing the NPM package, it's critical to use the npm dist-tag that corresponds to the major version of your Metabase. For example, if your Metabase is version 1.53.x, you'd run `53-stable`. See [SDK versioning](./version.md).
+When installing the npm package, it's critical to use the npm dist-tag that corresponds to the major version of your Metabase. For example, if your Metabase is version 1.56.x, you'd run `56-stable`. See [SDK versioning](./version.md).
-Via NPM:
+Via npm:
```
npm install @metabase/embedding-sdk-react@53-stable
diff --git a/docs/embedding/sdk/upgrade.md b/docs/embedding/sdk/upgrade.md
index 476f2de4d0e..05aad031af3 100644
--- a/docs/embedding/sdk/upgrade.md
+++ b/docs/embedding/sdk/upgrade.md
@@ -7,13 +7,13 @@ summary: How to upgrade your Metabase and Embedded analytics SDK versions, test
Here's a basic overview of the steps you'll want to take when upgrading your SDK.
-## 1. Read the release post and changelog for both Metabase and the Embedded analytics SDK
+## 1. Read the release post and changelog for Metabase and the Embedded analytics SDK
- [Release posts](https://www.metabase.com/releases) give a good overview of what's in each release, and call out breaking changes (which are rare).
- [Metabase changelogs](https://www.metabase.com/changelog) list Metabase changes.
-- [Embedded analytics SDK changelogs](https://www.metabase.com/changelog/55) list changes specific to the SDK package.
+- [Embedded analytics SDK changelogs](https://www.metabase.com/changelog/56) list changes specific to the SDK Package.
-Check for any relevant changes, especially breaking changes that require you to update your application's code. If there are breaking changes, we'll have docs that'll walk you through what changes you'll need to make and why.
+Check for any relevant changes, especially deprecations or breaking changes that require you to update your application's code. If there are deprecation changes, we'll have docs that'll walk you through what changes you'll need to make and why.
## 2. Test the upgrade
@@ -25,11 +25,11 @@ You can do this locally or in a dev instance. If your testing setup involves a l
See [upgrading Metabase](../../installation-and-operation/upgrading-metabase.md).
-### Upgrade the SDK with npm or yarn
+### Upgrade the SDK with npm or Yarn
You'll want to test the changes locally first, as there may be breaking changes that require you to upgrade your application code.
-Check out a new branch in your application and install the next stable version, either with npm or yarn:
+Check out a new branch in your application and install the next stable version, either with npm or Yarn:
Via npm:
@@ -37,13 +37,13 @@ Via npm:
npm install @metabase/embedding-sdk-react@{next-major-version-number}-stable
```
-For example, if you were upgrading to version 55 of the SDK:
+For example, if you were upgrading to version 56 of the SDK:
```bash
-npm install @metabase/embedding-sdk-react@55-stable
+npm install @metabase/embedding-sdk-react@56-stable
```
-If you're using yarn:
+If you're using Yarn:
```bash
yarn add @metabase/embedding-sdk-react@{next-major-version-number}-stable
@@ -51,12 +51,15 @@ yarn add @metabase/embedding-sdk-react@{next-major-version-number}-stable
See more on [SDK versions](./version.md).
-### If there are breaking changes, make the necessary changes to your application code
+### If there are deprecations or breaking changes changes, make the necessary changes to your application code
-Breaking changes are rare, but if you do need to make changes, we'll mention it in the release notes for the new major version and have docs that walk you through the changes.
+Deprecations or breaking changes are rare, but if you do need to make changes, we'll mention it in the release notes for the new major version and have docs that walk you through the changes.
Update or add tests for any application code changes that you make.
+In most cases, a deprecated change becomes a breaking change in the release following its deprecation.
+For example, if we plan to remove a prop from an SDK React component, we first mark it as **deprecated**, and then remove it in the next release.
+
### Deploy to your staging environment
Before deploying your app to your staging environment, make sure you've tested your app locally (manually, as well as running any automated tests).
@@ -69,6 +72,12 @@ If everything is working in staging, you're ready to deploy to production.
Be sure to deploy your application changes and upgrade your Metabase in parallel so that the SDK version and the Metabase version stay in sync.
+### Caching may delay the upgrade by up to a minute
+
+This is intentional. After upgrading, Metabase may still serve the previous, cached version of the SDK Bundle for up to 60 seconds (`Cache-Control: public, max-age=60`). This short cache window helps ensure fast performance while still allowing updates to propagate quickly.
+
+If you don’t see your changes immediately, clear your browser's cache or just wait a minute. After that, the SDK Package will load the newly deployed SDK Bundle.
+
### If your instance is pinned on Metabase Cloud, you'll need to request an upgrade
If you're on Metabase Cloud, and you've [pinned the version of your Metabase](./version.md#you-can-pin-instances-to-a-version-on-metabase-cloud), you'll need to request an upgrade by [contacting support](https://www.metabase.com/help-premium).
diff --git a/docs/embedding/sdk/version.md b/docs/embedding/sdk/version.md
index 1240e2fcf60..6463df13114 100644
--- a/docs/embedding/sdk/version.md
+++ b/docs/embedding/sdk/version.md
@@ -8,12 +8,12 @@ title: Embedded analytics SDK - versions
The SDK stable version tracks with the Metabase version.
-So, for example, if you're on Metabase 55 (`0.55.x`, `1.55.x`), _any_ version 0.55.x of the @metabase/embedding-sdk-react npm package will be compatible.
+So, for example, if you're on Metabase 56 (`0.56.x`, `1.56.x`), _any_ version 0.56.x of the @metabase/embedding-sdk-react npm package will be compatible.
-To simplify things, we publish dist-tags for each stable Metabase version. For example, to install the latest version of the SDK compatible with Metabase 55, run:
+To simplify things, we publish dist-tags for each stable Metabase version. For example, to install the latest version of the SDK compatible with Metabase 56, run:
```sh
-npm install @metabase/embedding-sdk-react@55-stable
+npm install @metabase/embedding-sdk-react@56-stable
```
To grab the latest version of the SDK that works with Metabase nightly builds, use the `canary` dist-tag.