npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@onreadydesa/vtex-node-sdk

v1.16.0-beta

Published

VTEX Node SDK, built 100% with Typescript and 0 dependencies!

Downloads

51

Readme

VTEX NODE SDK

  • :hammer: Built 100% with Typescript.
  • :muscle: 0 dependencies. It uses the native https Node module.
  • :tada: Promise based.
  • :dizzy: Type definitions for many VTEX requests and responses.

Note: This is not a VTEX official package, we are VTEX Partners since 2017 and we developed this to collaborate with VTEX Community.

Requirements

  • Node version >= 8

Installation

npm install @onreadydesa/vtex-node-sdk --save

or

yarn add @onreadydesa/vtex-node-sdk

Basic usage example

First, import the SDK:

const { VTEX } = require('@onreadydesa/vtex-node-sdk');
Using ES6 imports
import { VTEX } from '@onreadydesa/vtex-node-sdk';

Then, use the SDK like this:

const vtex = new Vtex('store name', 'app key', 'app token');

// Get order by id
vtex.oms.orders.getOrder('orderId')
  .then((response) => {
    console.log(response.status); // 200
    console.log(response.body); // { orderId: 'orderId', ... }
  })
  .catch((error) => {
    console.log(error.status);
    console.log(error.body);
  })
Using async/await
try {
  const response = await vtex.oms.orders.getOrder('orderId');
  console.log(response);
} catch (error) {
  console.log(error);
}

VTEX Environments

By default, the SDK makes all requests to vtexcommercestable environment. If you want to use another environment (For example, vtexcommercebeta), you can pass an extra argument like this:

const { VTEX } = require('@onreadydesa/vtex-node-sdk')

const vtex = new Vtex('store name', 'app key', 'app token', 'beta');

Current implemented APIS

The final goal is to implement all VTEX Rest Apis. Feel free to contribute.

API | Implemented :------------: | :-------------:| OMS | :white_check_mark: | Logistics | :white_check_mark: | Pricing | :white_check_mark: | Master Data (V2) | :white_check_mark: (*) Attachments API pending | Catalog | :white_check_mark: | Search | :white_check_mark: | Payments Gateway | :white_check_mark: | Suggestions | :white_check_mark: | VTEX DO | :white_check_mark: | CMS | :white_check_mark: | Session Manager | :white_check_mark: | License Manager | :white_check_mark: | Customer Credit | :white_check_mark: | Subscriptions (V2) | :white_check_mark: | Rates and Benefits | :white_check_mark: | Checkout | :white_check_mark: | Giftcard Hub | :white_check_mark: | Antifraud Provider | :x: | Giftcard | :x: | Giftcard Provider Protocol | :x: | Payment Provider Protocol | :x: |