This code highly bases on the Administration Code and made NodeJs compatible.
import{createFromPasswordAndLogin}from'shopware-admin-api';letapi=awaitcreateFromPasswordAndLogin('http://myshop.com','username','password',1);import{createFromIntegration}from'shopware-admin-api';letapi=awaitcreateFromIntegration('http://myshop.com','client_id','client_secret',1);// Create repositoryconstproductRepository=api.create('product');// Access default contextconstcontext=api.defaultContext();// Acccess entity definition (contains the schema, required fields etc.)constdefinition=api.EntityDefinition;console.log(definition.get('product'))console.log(definition.getRequiredFields('product'))