Skip to content

Add custom module

Add custom module

In your app, you are able to add your own module to the administration, that can be accessed via the My Extensions listing. Your custom module consists of an iframe that is embedded in the Shopware administration and within this iframe, your website will be loaded and shown.

In order to create a custom module, you need to define an admin element to define <admin> extensions. In there, please add your module by defining a <module> element.

  • Here you're able to define the technical name of your module and the source: Please insert the link to your website there.
  • To define the module's title and its translation, you can add a label as child element.
// manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:xsi="" xsi:noNamespaceSchemaLocation="">
        <module name="exampleModule" source="">
            <label>Example Module</label>
            <label lang="de-DE">Beispiel Modul</label>

For a complete reference of the structure of the manifest file take a look at the Manifest reference.

If the user opens the module in the administration your app will receive a request to the given source url. Your app can determine the shop that has opened the module through query parameters added to the url:

  • shop-id: The unique identifier of the shop, where the app was installed
  • shop-url: The URL of the shop, this can later be used to access the Shopware API
  • timestamp: The Unix timestamp when the request was created
  • shopware-shop-signature: sha256 hmac of the rest of the query string, signed with the shop-secret

A sample request may look like this:


In this case the shopware-shop-signature parameter contains an sha256 hmac of the rest of the query string, signed again with the secret your app assigned the shop during the registration. The signature can be used to verify the authenticity of the request.

Leave loading state

One last thing in here - the most important of the Javascript part of the view: At first, your new module will display a loading spinner to signalize your iframe is loading. To leave the loading state, your iframe needs to give a notification when the loading process is done.

function sendReadyState() {
    window.parent.postMessage('sw-app-loaded', '*');

This has to be done as soon as everything is loaded so that the loading spinner disappears. If your view is not fully loaded after 5 seconds, it will be aborted.