# Yarn
yarn add vtex-api
# NPM
npm install --save vtex-api
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';
If you need coverage old browsers, you need use an fetch
polyfill, like whatwg-fetch or unfetch.
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)
})
Name | Description | Docs |
---|---|---|
searchDocument() |
Query a collection of documents | 📝 |
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the MIT License - see the LICENSE.md file for details