Home Manual Reference Source

Using the SDK

Installation

Install the module using yarn:

$ yarn add -D viswiz-sdk

Or using npm:

$ npm install -D viswiz-sdk

Configuration

The SDK can use an API key from the environment variable VISWIZ_API_KEY, so it does not need to be exposed in the code base.

Usage

Using async/await (node 8+):

const VisWiz = require('viswiz-sdk');

async function run() {
    const client = new VisWiz('your-unique-api-key-here');

    const projects = await client.getProjects();
    const project = projects.find(project => project.name === 'Foo');

    await client.buildWithImages({
        branch: 'master',
        name: 'Foo Bar',
        projectID: project.id,
        revision: 'abcdef1234567890',
    }, '/path/to/images');
}

run();

Using Promise:

const VisWiz = require('viswiz-sdk');

// Assuming environment variable VISWIZ_API_KEY is set
const client = new VisWiz();

client.getProjects()
    .then(projects => projects.find(project => project.name === 'Foo'))
    .then(project => client.buildWithImages({
        branch: 'master',
        name: 'Foo Bar',
        projectID: project.id,
        revision: 'abcdef1234567890',
    }, '/path/to/images'));

ES module

import VisWiz from 'viswiz-sdk/es';

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

5.2.2 (2020-07-04)

Bug Fixes

  • Retry images without streams (4c33903)

5.2.1 (2020-05-23)

Bug Fixes

  • Upgrade all dependencies (5c11546)

5.2.0 (2020-05-12)

Features

  • Retry images create requests (119e99f)

5.1.0 (2020-03-21)

Features

  • Upload images concurrently (85eaa27)

Bug Fixes

  • Upgrade all dependencies (90ee878)

5.0.0 (2020-02-04)

⚠ BREAKING CHANGES

  • Drop support for node 8
  • Images in folders start using / as the folder separator. Previously this was replaced with __.

Features

  • Allow folder separators inside image names (e008663)

Bug Fixes

  • Upgrade all dependencies (ce4dcea)

4.0.0 (2019-09-09)

⚠ BREAKING CHANGES

3.0.0 (2019-09-09)

⚠ BREAKING CHANGES

  • Image names are different compared to previous versions under Windows.

Bug Fixes

  • Paths under Windows get properly their prefix removed :bug: (54f13b3)

2.1.0 (2019-09-09)

Bug Fixes

  • CLI wait for result uses the project threshold for comparison (169a2d5)

Features

  • New SDK method: getProject (19d0709)

2.0.1 (2019-09-08)

Bug Fixes

  • Move babel-jest to devDependencies :bug: (29b9e46)

2.0.0 (2019-09-06)

⚠ BREAKING CHANGES

  • Image names might be different compared to previous versions, which were not correctly removing the folder prefix.

Bug Fixes

  • Build operation removes folder prefix from image names :bug: (fbebda8)
  • Progress bar displays correctly :bug: (b01cb5a)

Features

  • CLI build with wait for results flag (b2434c8)

1.5.1 (2019-09-02)

Bug Fixes

  • Upgrade dependencies :arrow_up: (54f0674)
  • Use all CLI options :bug: (1d2a9ad)

1.5.0 (2018-10-07)

Bug Fixes

  • Catch and output errors in CLI commands (8de7c23)
  • ES version uses real ES sources (7864576)
  • Upgrade dependencies :arrow_up: (c4b957d)

Features

  • Progress indicator for build CLI command :tada: (7868350), closes #1

1.4.0 (2018-10-06)

Features

  • Image directory is scanned recursively for images :sparkles: (23a3399)

1.3.3 (2018-03-15)

1.3.2 (2018-03-02)

Bug Fixes

  • CLI build outputs the correct report URL when finished :bug: (25d66cd)

1.3.1 (2018-03-01)

Bug Fixes

  • Setup bin link on install (386c076)

1.3.0 (2018-03-01)

Features

1.2.0 (2018-02-22)

Features

  • Fallback to use API key from environment variable (4cbba7e)
  • New method for simpler usage: buildWithImages (f742055)

1.1.2 (2018-02-08)

Bug Fixes

  • Package main and module exports :bug: (da5bd85)

1.1.1 (2018-01-22)

Bug Fixes

  • Export both CommonJS and ES module :bug: (0a6b1ef)

1.1.0 (2018-01-16)

Bug Fixes

  • Add finishBuild to usage examples docs :memo: (304a435)

Features

  • Project notifications :tada: (caad9b6)

1.0.4 (2017-12-12)

Bug Fixes

1.0.3 (2017-12-08)

Bug Fixes

  • Update readme links and format (c1fa8cf)

1.0.2 (2017-12-07)

Bug Fixes

  • Correct github URL :bug: (e97ea83)

1.0.1 (2017-12-07)

Bug Fixes

  • Updated docs with string IDs :twisted_rightwards_arrows: (453eec0)

1.0.0 (2017-12-04)

Features