JSPM

@particular./zendesk-magento-m1-request

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q53827F
  • License MIT

Please contact Particular. via info@uniquelyparticular.com for any questions

Package Exports

  • @particular./zendesk-magento-m1-request

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@particular./zendesk-magento-m1-request) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@particular./zendesk-magento-m1-request

npm version semantic-release code style: prettier CircleCI dependency status: david

🎮 Minimal Magento m1 API request library for Node (design for use w/ Zendesk Extension)

Installation

yarn add @particular./zendesk-magento-m1-request # npm install @particular./zendesk-magento-m1-request

Quickstart (OAuth)

const { createClient } = require('@particular./zendesk-magento-m1-request');
// import { createClient } from '@particular./zendesk-magento-m1-request'

const magentoM1 = new createClient({
  store_url: 'https://.../...', //Magento m1 Store URL
  access_token: '...' //Access token generated after installing/configuring Zendesk extension
});

magentoM1
  .get(`zendesk/api/customers/${email}`)
  .then(console.log)
  .catch(console.error);

Custom headers per request

The API provides you the ability to send various request headers that change the way data is stored or retrieved.

By default this library will encode all data as JSON, however you can customise this by setting your own Content-Type header as an additional argument to get, patch, post, put and delete.

Note: If you add the Content-Type custom header to patch, post, put or delete you will need to encode data yourself.

const magentoM1 = new createClient({
  store_url: 'https://.../...', //Magento m1 Store URL
  access_token: '...' //Access token generated after installing/configuring Zendesk extension
});

const headers = {
  'X-My-Header': 'custom'
};

magentoM1
  .get(`zendesk/api/customers/${email}`, headers)
  .then(console.log)
  .catch(console.error);

Contact Adam Grohs @ Particular. for any questions.