Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

shyim/shopware-admin-api-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Admin Node-API Client for Shopware 6

This code highly bases on the Administration Code and made NodeJs compatible.

Creation of API Client

Using Username and Password

import {createFromPasswordAndLogin} from 'shopware-admin-api';

let api = await createFromPasswordAndLogin('http://myshop.com', 'username', 'password', 1);

Using Integration

import {createFromIntegration} from 'shopware-admin-api';

let api = await createFromIntegration('http://myshop.com', 'client_id', 'client_secret', 1);

Usage

// Create repository
const productRepository = api.create('product');

// Access default context
const context = api.defaultContext();

// Acccess entity definition (contains the schema, required fields etc.)
const definition = api.EntityDefinition;

console.log(definition.get('product'))
console.log(definition.getRequiredFields('product'))

License

MIT