Welcome!

VersionOne JavaScript SDK Scenario

Difficulty:beginner

Estimated Time:10 minutes

We're going to learn how to use the VersionOne JavaScript SDK!

The APIs facilitate integration with external systems and allows direct queries to the VersionOne data and the SDK enables you to interface with the APIs with the programming language that fits into your tech stack.

Steps

VersionOne JavaScript SDK Scenario

Step 1 - Install the SDK

Task

Step 2 - Run Node

Start an interactive node session to use the sdk.

Task

Run the following command

node

Step 3 - Configure the SDK

Configure the SDK with your information

Task

The SDK makes asynchronous requests to the VersionOne system and therefore performs AJAX requests. The SDK does not require any specific ajax library to be used but instead affords extension points to use your own ajax mechanism. Two popular options are available out of the box including jQuery ajax and Axios.

In this scenario we will use axios.

const axios = require('axios');

Task

Include the sdk and configure it to use the axios ajax library

const v1sdk = require('v1sdk');

Using the sdk with commonjs in Node.js is slightly different than using import statements, but for the former run:

Debugging Scenarios

Help

Katacoda offerings an Interactive Learning Environment for Developers. This course uses a command line and a pre-configured sandboxed environment for you to use. Below are useful commands when working with the environment.

cd <directory>

Change directory

ls

List directory

echo 'contents' > <file>

Write contents to a file

cat <file>

Output contents of file

Vim

In the case of certain exercises you will be required to edit files or text. The best approach is with Vim. Vim has two different modes, one for entering commands (Command Mode) and the other for entering text (Insert Mode). You need to switch between these two modes based on what you want to do. The basic commands are: