npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vantiq-sdk

v1.2.2

Published

Vantiq NodeJS SDK

Downloads

7

Readme

Build Status

Vantiq Node.JS SDK

The Vantiq NodeJS SDK is JavaScript library that provides an API into a Vantiq system for NodeJS applications. The SDK connects to a Vantiq system using the Vantiq REST API.

Installation

The SDK is available as an NPM module. To install, use:

% npm install vantiq-sdk

Quick Start

You will need valid credentials on a Vantiq server. This can be in the form of a username and password OR an access token created in the Modelo UI for the server (under Administer menu -> Advanced -> Access Tokens). An access token is required for use with a cloud server or OAuth-enabled server. An access token OR the username/password option will work with a local or edge Vantiq server.

The first step is to create an instance of the Vantiq SDK providing the URL of the Vantiq server to connect:

var Vantiq = require('vantiq-sdk');

var vantiq = new Vantiq({ 
    server:     '<server>',
    apiVersion: 1
});

where <server> is the full URL for the Vantiq server to connect to, such as https://dev.vantiq.com and apiVersion is the version of the API to use. If not specified, this defaults to the latest version, currently 1. At this point, the Vantiq instance has not yet connected to the server.

If you have an access token for your Vantiq server, just set vantiq.accessToken to the token's value:

vantiq.accessToken = '<token value>';

Once you have done that, you are able to perform SDK calls like the select() shown below.

To establish a connection to the server using a username and password, use the authenticate method:

var promise = vantiq.authenticate('<username>', '<password>');
promise.then((result) => {
    console.log('Connected!');
});

The <username> and <password> are the same credentials used to log into the system. Note the username and password are not stored either in-memory or persistently after this authentication call. After successfully authenticating with the system, the Vantiq instance stores in-memory an access token that subsequent API calls will use.

Now, you are able to perform any SDK calls to the Vantiq server. For example, the following prints out the list of types that have been defined:

var promise = vantiq.select('system.types');
promise.then((resultSet) => {
    resultSet.forEach(entry => console.log(entry));
});

Documentation

For the full documentation on the SDK, see the SDK API Reference.

Examples

For examples of working applications that use the SDK, see the examples folder.

Copyright and License

Copyright © 2024 Vantiq, Inc. Code released under the MIT license.