# Release a plugin

> Share your plugin from a GitHub repository, a local directory, or an installed package, and state which SDK and host capabilities it needs.

You release a plugin by publishing its source or its package where DSUI can load it. Four numbers are separate: the version of the Plugin SDK that you build with, your plugin's `metadata.version`, the plugin API version `metadata.apiVersion`, and the DSUI version that runs it. A Plugin SDK release doesn't publish the product or change installed DSUI.

## Prepare the package

DSUI finds a plugin's server entry in `package.json`, in this order:

1. `main`, or `exports["."]` (also `exports` as a string)
2. `src/plugin.ts`, when the package names neither

The entry must be a TypeScript file whose default export is the plugin from `definePlugin`. DSUI doesn't read `dsui.entry` for plugins. For a browser component, add `dsui.browser` with the path of the browser entry. See [custom components](/docs/build/custom-components).

Pin the exact version of `@northgraindata/dsui-plugin-sdk` that you tested. Set `metadata.apiVersion` to `1`, the plugin API that DSUI supports. State the lowest DSUI version and the optional host capabilities that your plugin needs in its README and release notes. See [versions and compatibility](/docs/build/compatibility).

## Choose how people load it

- **`source: git`**: DSUI downloads a GitHub repository and builds it on start. People set `repository`, and optionally `ref` (default `main`), `path`, and `token` for a private repository. Tell them to set `ref` to a tag or a commit SHA
- **`source: local`**: DSUI builds a directory on the machine. Use it while you develop
- **`package`**: an npm package that is already installed where DSUI can resolve it, such as `node_modules` next to where DSUI starts. DSUI doesn't download it. A package can set `browserBundle` to the specifier of its browser entry

```yaml
plugins:
  example-plugin:
    package: "@your_org/dsui-plugin-example"
    browserBundle: "@your_org/dsui-plugin-example/browser"
```

DSUI doesn't load prebuilt GitHub artifacts that are pinned with `commit` and `integrity`. It rejects those fields as an invalid configuration, so use `source: git`.

## Trust and security

A plugin runs inside the DSUI server, with the access of the server. DSUI disables dependency lifecycle scripts when it installs, and the plugin's code still runs. People who load your plugin should read its source first. A plugin that handles authentication must also be loaded with `critical: true`. See [authentication and authorization](/docs/plugin-sdk/auth-providers).

## Releases of the SDK

The Plugin SDK has its own versions, changelog, and `plugin-sdk-vX.Y.Z` tags. New plugins use `@northgraindata/dsui-plugin-sdk`. See [versions and compatibility](/docs/build/compatibility).
