Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keystok

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keystok

Keystok Client

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Keystok Node.js Client Library

This library is used to access your Keystok keys from your Node.js applications.

Installation

npm install keystok

Retrieving a single key

var keystok = require('keystok')('accesstoken');
keystok.get('keyid', function(err, key) {
    console.log('key:', key);
});

Retrieving multiple keys

var keystok = require('keystok')('accesstoken');
keystok.get(['keyid1', 'keyid2', 'keyid3'], function(err, keys) {
    console.log('keys:', keys);
});

Retrieving all keys

var keystok = require('keystok')('accesstoken');
keystok.getAll(function(err, keys) {
    console.log('keys:', keys);
});

Options

When creating the Keystok client library object, you can specify either an access token string or an options object. The options object can specify these options (all except accessToken have default values):

var keystok = require('keystok')({
    accessToken: 'accesstoken',
    apiHost: 'api.keystok.com',
    timeout: 5000,
    cache: true,
    cacheDir: '/tmp/keystok'
});

To use the default options, just use this:

var keystok = require('keystok')('accesstoken');

Note: The cacheDir option actually defaults to os.tmpdir() instead of '/tmp'.

Keywords

FAQs

Package last updated on 19 May 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc