Table of Contents
Install
# Yarn
yarn add vtex-api
# NPM
npm install --save vtex-api
Usage
Imports
You can import each method individually
import searchDocument from 'vtex-api/lib/searchDocument';
or use ES6 named import (tree shaking recommended)
import { searchDocument } from 'vtex-api';
Old Browsers support
If you need coverage old browsers, you need use an fetch
polyfill, like whatwg-fetch or unfetch.
Node
For NodeJS usage, you will need some Isomorphic Fetch lib, like isomorphic-fetch (and isomorphic-form-data if you will use uploadFile()
method)
For authentication, each method has keys for this purpose:
const response = await searchDocument({
...
auth: { appKey: '123', appToken: 'abc' }, // Your private keys (use it ONLY on backend)
accountName: 'storename', // Account name (will build full URL request)
})
API
Masterdata
Name | Description | Docs |
---|---|---|
searchDocument() |
Query a collection of documents |
Product
Helpers
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the MIT License - see the LICENSE.md file for details