GithubHelp home page GithubHelp logo

ahmed-shehata / atlas-js-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zalando-incubator/atlas-js-core

0.0 2.0 0.0 2.39 MB

JavaScript SDK Core for Zalando Checkout, Guest Checkout, and Catalog APIs

License: Other

JavaScript 100.00%

atlas-js-core's Introduction

npm downloads MIT licensed Build Status David codecov Commitizen friendly semantic-release

Atlas JavaScript SDK Core

This SDK covers the functionality provided by team Atlas' (aka Distributed Commerce) APIs, namely, Checkout, Guest Checkout, and Catalog APIs.

Those APIs, and in turn this SDK, provide our partners a more streamlined access the Zalando shopping platform to enable our customers to purchase wherever they are.

The purpose of this project is to provide low-level calls to API backend and response models for Zalando Checkout, Guest Checkout, and Catalog APIs in order to allow easily integrate and run Zalando Сheckout in minutes using your own UI solution.

If you want to access the APIs directly we recommend that you take a look at their documentation.

We use Promises a lot :)

Installation

npm install --save atlas-sdk-core es6-promise

On install we're transpiling the code for your convenience. You have access to two files under a lib/ folder, one for using in node and another for browser usages.

Warning

Because we are using Promises you must bring your own ES6 Promise compatible polyfill, e.g. es6-promise.

Configuration and Usage

You need to configure Atlas JavaScript SDK Core first and use configured instance variable to interact with AtlasSDK.

In order to configure AtlasSDK manually provide an object with 2 mandatory parameters client_id and sales_channel:

import AtlasSDK from 'atlas-sdk-core';

AtlasSDK.configure({
  client_id: 'CLIENT_ID',
  sales_channel: 'SALES_CHANNEL',
  is_sandbox: true
}).then((sdk) => {
  // sdk instance is ready to use

  sdk.getArticle('AD112B0F6-A11').then((article) => {
    console.log(`Article name: ${article.name}`);
  });
}).catch((error) => {
  console.error(`${error}`);
});

Since we are using Promises you can benefit from await/async:

import AtlasSDK from 'atlas-sdk-core';

const sdk = await AtlasSDK.configure({
  client_id: 'CLIENT_ID',
  sales_channel: 'SALES_CHANNEL'
});
const article = await sdk.getArticle('AD112B0F6-A11');
console.log(`Article name: ${article.name}`);

Local Development

If you want to contribute, please, read our Contributing guidelines first.

In order to start SDK development simply run

npm run tdd

Check existing codebase tests for test examples.

AtlasSDK Documentation

AtlasSDK Reference Documentation is generated automatically during the production build.

Contact

For any inquiry, please contact Team Atlas via [email protected]

LICENSE

The MIT License (MIT) Copyright © 2016 Zalando SE, https://tech.zalando.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

atlas-js-core's People

Contributors

ahmed-shehata avatar artdaw avatar gregsen avatar mrandi avatar pc-alves avatar ricardomatias avatar sangdol avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.