@weavix/sdk-core
v0.0.27
Published
Generic plugin SDK core runtime — framework-agnostic, no Tracker-specific types or Tracker HTTP client.
Readme
@weavix/sdk-core
Generic plugin SDK core runtime — framework-agnostic, no Tracker-specific types or Tracker HTTP client.
Installation
npm install @weavix/sdk-coreUsage
import { hostApi, uiApi, on } from '@weavix/sdk-core';
// Initialize the plugin bridge
hostApi.init({ autoResize: true });
// Listen to host events
on('context.changed', (context) => {
console.log('Context:', context);
});What's included
- Bridge:
initBridge,sendRequest— low-level postMessage communication - Host API:
hostApi— init, getTheme, getLanguage, notifyReady, resize, etc. - Events:
on,dispatchHostEvent,eventBus— reactive host event subscriptions - UI:
uiApi— navigate, toaster, confirm - Utils:
getField,getLocalizedString— utility helpers - Error codes:
METHOD_NOT_SUPPORTED,MISSING_REQUIRED_SCOPE, etc.
For Tracker plugins
Use @yandex-data-ui/tracker-plugin-sdk-core (internal) or @weavix/tracker-plugin-sdk (external) for typed Tracker API (trackerApi.v3, …) and host wrappers.
