@nopcommerce/frontend
TypeScript icon, indicating that this package has built-in type declarations

1.6.1 • Public • Published

@nopcommerce/frontend (unofficial)

This (unofficial) project aims to provide an api client for the official NopCommerce API Plugin. You will need to buy this api seperately to be able to use this package.

This package provides an auto-generated client stub for the NopCommerce Frontend API, including typescript type definitions.

Installation

npm i @nopcommerce/frontend

Usage

import {
    OpenAPI,
    AuthenticateService,
    CustomerService,
} from '@nopcommerce/frontend';

// use this api endpoint (make sure to only write the host here, without trailing slash)
OpenAPI.BASE = 'http://localhost:5000';

// get a nopcommerce api token
const response = await AuthenticateService.postGetToken({
    email: 'demo@demo.com',
    password: 'demo',
    is_guest: false,
});

// assign the current token to be used by the api
OpenAPI.TOKEN = response.token;

// get the customer info from nopcommerce
const customerInfo = await CustomerService.getInfo();
console.log(customerInfo.email);

Example application

Head over to the repository here to see a small svelte-based demo application

Contributing

Contributions are always welcome! Please see here for more details

License

MIT

Package Sidebar

Install

npm i @nopcommerce/frontend

Weekly Downloads

0

Version

1.6.1

License

MIT

Unpacked Size

339 kB

Total Files

542

Last publish

Collaborators

  • manuel3108