New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@vtex/api

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtex/api

VTEX I/O API client

85

Supply Chain Security

92

Quality

86

Maintenance

100

Vulnerabilities

100

License


Version published
Weekly downloads
4.7K
decreased by-12.86%
Maintainers
22
Weekly downloads
 
Created
Issues
48

VTEX IO API Client for Node

This client enables Node developers to quickly integrate with the VTEX IO APIs.

Build Status

Getting started

The clients currently available in this library are:

Usage:

import { AppsClient } from '@vtex/api';

const client = new AppsClient({
  authToken: yourAuthToken,
  userAgent: myUserAgent
});

Development

Install the dependencies (npm install) and run npm run build.

Using VBaseClient.sendFile

An example usage of the three supported methods of sending a file to VBase:

import {VBase} from '@vtex/api'
import {createReadStream} from 'fs'

const client = new VBase({
  account: 'account',
  workspace: 'workspace',
  authToken: 'test',
  userAgent: 'test send',
  region: 'aws-us-east-1',
})

client.saveFile(
  'bucket',
  'test-send-stream-gzip.txt',
  createReadStream('./test-send.txt'),
  {gzip: true, gzipOptions: {level: 9}}
).then((res) => {
  console.log('gz:', res)
})

client.saveFile(
  'bucket',
  'test-send-stream.txt',
  createReadStream('./test-send.txt'),
  {gzip: false}
).then((res) => {
  console.log('stream:', res)
})

client.saveFile(
  'bucket',
  'test-send-file.txt',
  './test-send.txt'
).then((res) => {
  console.log('file:', res)
})

Keywords

FAQs

Package last updated on 18 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts