{"id":26984255,"url":"https://github.com/friendsofshopware/shopware-storefront-sdk","last_synced_at":"2025-04-03T17:35:53.934Z","repository":{"id":56870921,"uuid":"526348071","full_name":"FriendsOfShopware/shopware-storefront-sdk","owner":"FriendsOfShopware","description":"Shopware Storefront SDK","archived":false,"fork":false,"pushed_at":"2024-02-26T13:53:00.000Z","size":161,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T13:02:05.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FriendsOfShopware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-18T19:29:42.000Z","updated_at":"2024-11-09T17:35:06.000Z","dependencies_parsed_at":"2024-10-23T05:09:02.920Z","dependency_job_id":null,"html_url":"https://github.com/FriendsOfShopware/shopware-storefront-sdk","commit_stats":{"total_commits":42,"total_committers":5,"mean_commits":8.4,"dds":"0.11904761904761907","last_synced_commit":"65546b416b9bb8ecc958d5989e7782b32e88f8f4"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fshopware-storefront-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fshopware-storefront-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fshopware-storefront-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fshopware-storefront-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendsOfShopware","download_url":"https://codeload.github.com/FriendsOfShopware/shopware-storefront-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247049694,"owners_count":20875289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-03T17:35:53.380Z","updated_at":"2025-04-03T17:35:53.924Z","avatar_url":"https://github.com/FriendsOfShopware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shopware Storefront SDK\n\n## Description\n\nThe Shopware Storefront SDK is a set of classes and methods to easily access the Shopware Storefront.\nSo in your plugins, you can add this package as dependency and use the classes from this package instead of default Shopware files.\nThis is especially helpful if you want to build your plugin without having the Shopware code-base, such as in custom webpack builds.\n\n## Features\n\n- Build Shopware Version independent plugin\n- Ability to build your plugin javascript without having the Shopware 6 code-base\n\n## Installation\n\n```bash\nnpm install @friendsofshopware/storefront-sdk\n```\n\n## Webpack Configuration\n\nThis package is usually used to build artifacts independent from Shopware.\nHowever, you might still want to be able to also build your storefront inside a Shopware shop.\n\nFor this, please create a custom webpack configuration in your plugin that resolves the alias and path for your dependency.\n\nCreate a new file **../Resources/app/storefront/build/webpack.config.js** and add this content:\n\n```js\nmodule.exports = (params) =\u003e {\n    return {\n        resolve: {\n            modules: [\n                `${params.basePath}/Resources/app/storefront/node_modules`,\n            ],\n        }\n    };\n}\n```\n\n## TSConfig\n\nTo have `PluginManager` typed, you need to create a `tsconfig.json` (`src/Resources/app/storefront/tsconfig.json`) with following content:\n\n```json\n{\n    \"compilerOptions\": {\n        \"types\": [\"@shopware-ag/storefront-types\"]\n    }\n}\n```\n\n`@shopware-ag/storefront-types` is a separate NPM package which contains only the types of the storefront.\n\n## Usage\n\n### Creating JS Plugin\n\nYou can now use the plugin classes from this package instead of the original ones in your Shopware Javascript plugins.\n\n```js\nimport Plugin from '@friendsofshopware/storefront-sdk/plugin-system/plugin.class';\n\nexport default class MyStorefrontPlugin extends Plugin {\n    constructor(el, options, pluginName) {\n        super(el, options, pluginName);\n\n        this.setup();\n    }\n\n    init(): void {\n        // run your own code here\n        this.el.addEventListener('click', this.onClick.bind(this));\n    }\n\n    onClick(event) {\n        console.log('called');\n    }\n}\n```\n\n## Build\n\nBecause you have no dependency on Shopware classes anymore, can now build your plugins without having Shopware itself.\nThis is helpful if you want to create custom webpack builds for your plugin.\n\nBut you can also use the Shopware CLI or still Shopware itself for building.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendsofshopware%2Fshopware-storefront-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendsofshopware%2Fshopware-storefront-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendsofshopware%2Fshopware-storefront-sdk/lists"}