Socket
Book a DemoInstallSign in
Socket

@vtex/api

Package Overview
Dependencies
Maintainers
6
Versions
954
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtex/api

VTEX I/O API client

Source
npmnpm
Version
0.12.11
Version published
Maintainers
6
Created
Source

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:

  • AppsClient
  • RegistryClient
  • VBaseClient
  • VTEXIDClient

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 method of sending a file to VBase:

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

const client = new VBaseClient({
  authToken: 'test',
  userAgent: 'test send',
  endpointUrl: 'BETA',
})

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

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

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

Keywords

vtex

FAQs

Package last updated on 30 Jan 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