Skip to content

Usage

After installing the Meteor Admin SDK, you can use it in your extensions. Most extensions should use the NPM package with a bundler such as Vite. This provides proper dependency management, type support, and better integration with modern development workflows.

Show a notification

One of the simplest SDK interactions is showing a notification in the Shopware Administration:

js
// import notification toolkit from the SDK
import { notification } from '@shopware-ag/meteor-admin-sdk';

// dispatch a new notification
notification.dispatch({
  title: 'My first notification',
  message: 'This was really easy to do'
});

Add a UI extension

Use UI APIs to place your extension inside existing Administration views:

js
import { ui } from '@shopware-ag/meteor-admin-sdk';

ui.componentSection.add({
  component: 'card',
  positionId: 'sw-product-properties__before',
  props: {
    title: 'Extra product details',
    locationId: 'product-extra-details'
  }
});

See Component Sections and Locations for the full flow.

Read Administration context

Use context APIs when your extension needs information about the current Administration session:

js
import { context } from '@shopware-ag/meteor-admin-sdk';

const language = await context.getLanguage();
console.log(language.languageId);

See the Context API reference for all available methods.

Subscribe to data changes

Use data APIs when your extension should react to entity changes in the current view:

js
import { data } from '@shopware-ag/meteor-admin-sdk';

data.subscribe('sw-product-detail', (payload) => {
  console.log('Product data changed', payload);
});

See Subscribe, Get, and Repository for more data access patterns.

Find more examples

For more complete examples and API details, continue with:

Was this page helpful?
UnsatisfiedSatisfied
Be the first to vote!
0.0 / 5  (0 votes)