New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

alks.js

Package Overview
Dependencies
Maintainers
0
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alks.js

JavaScript client for the ALKS API, usable in both modern browsers and node.js

  • 2.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
317
decreased by-20.55%
Maintainers
0
Weekly downloads
 
Created
Source

alks.js

Build Status npm version

JavaScript client for the ALKS API, usable in both modern browsers and node.js

It provides a lightweight wrapper around the ALKS REST API, with the following features:

  • No dependencies in browser, only one dependency in node.js
  • Implemented with promises, leveraging fetch instead of XMLHttpRequest
  • Promises reject with ALKS-provided status messages when available
  • Each method returns only the appropriate data from the API response
  • Fully documented with JSDoc
  • Works with no polyfills in latest Chrome, Firefox and Safari

For browser usage, it expects fetch (and Promises) to be available. If they're not, you'll need to polyfill them.

Installation

Install with NPM like this

npm install alks.js

or Yarn

yarn install alks.js

Example

// Using ES2015 module syntax
import * as ALKS from 'alks.js';

// Using node's require syntax
const ALKS = require('alks.js');

const myAlks = ALKS.create({
  baseUrl: 'https://your.alks-host.com',
  accessToken: 'abc123',
});

myAlks.getKeys({
  account: '012345678910/ALKSPowerUser',
  role: 'PowerUser',
  sessionTime: 1
}).then((creds) => {
  console.log(`here are your temporary access keys:
    Access Key: ${creds.accessKey}
    Secret Key: ${creds.secretKey}
    Session Token: ${creds.sessionToken}`);
});

Documentation

View the API documentation

To update the API documentation from the source, run npm run docs

Tests

Run both node.js and browser tests with npm test (must have Chrome installed)

FAQs

Package last updated on 10 Jan 2025

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