Developer tools
The toolkit for developing plugins consists of two parts: an SDK that you connect in the plugin code and a CLI that helps you manage the plugin lifecycle. All tools are distributed as NPM packages.
SDK
You interact with Tracker using the SDK, which is connected as a library. The SDK provides both UI-level interaction methods and methods for working with the Tracker public API.
The SDK is available in two formats:
@weavix/tracker-plugin-sdk-react- React-like approach. Used in templates and examples. Recommended for use.@weavix/tracker-plugin-sdk-core- pure JS. Can be used with any framework.
CLI
CLI is a console utility as an NPM package that handles the entire plugin lifecycle: creation, debugging, validation, and publication.
Component library
For interface development, we recommend using the Gravity-UI design system components. They are used to build the Tracker interface itself, so using them will give you the closest UX. In the future, we will additionally release a library of components with Tracker-specific components.
Note
If you create a plugin via CLI, Gravity UI and the necessary styles will already be included in the project. CLI will also add theme files to the src/themes directory. You don't need to install and import the @yandex-data-ui/gravity-themes package.
To make the components switch together with the Tracker theme, get the theme value via useTrackerPluginContext() and pass it to ThemeProvider:
import {ThemeProvider} from '@gravity-ui/uikit';
import {useTrackerPluginContext} from '@weavix/tracker-plugin-sdk-react';
const App = () => {
const {theme} = useTrackerPluginContext();
return <ThemeProvider theme={theme}>Plugin code</ThemeProvider>;
};