diff --git a/packages/plugin-sdk/README.md b/packages/plugin-sdk/README.md index efd2182..7b0a0d2 100644 --- a/packages/plugin-sdk/README.md +++ b/packages/plugin-sdk/README.md @@ -54,6 +54,67 @@ yarn add @sigmacomputing/plugin npm install @sigmacomputing/plugin ``` +#### Using the UMD bundle from a CDN + +If you are not using a bundler, you can load `@sigmacomputing/plugin` directly +from a CDN such as [jsDelivr](https://www.jsdelivr.com/) or +[unpkg](https://unpkg.com/). The package ships a pre-built, minified UMD bundle +that exposes its exports on the `SigmaPlugin` global. + +```html + + + + + +``` + +We recommend pinning to a specific version in production so updates don't +silently change behavior: + +```html + + + + + +``` + +Once the script is loaded, the SDK is available as `window.SigmaPlugin`: + +```html + +``` + +React is treated as an external dependency in the UMD bundle. If you want to +use the React API (`SigmaClientProvider`, `usePlugin`, etc.) from the CDN +build, load React first so the global `React` is available before the SDK +script runs: + +```html + + + +``` + If you have yet to set up your development environment, follow one of the setup guides below