Akamai Auth Token Generator

1.0.7 · abandoned · verified Wed Apr 22

This JavaScript library, currently at version 1.0.7, provides a utility for generating Akamai authentication tokens within Node.js environments. Published over six years ago, it appears to be unmaintained, with no discernible release cadence or active development. It offers basic token generation with configurable algorithms (e.g., SHA256), access control lists (`acl`), token window durations, and a private key. Its primary differentiation lies in its direct, minimal approach to Akamai token creation, bypassing more comprehensive Akamai SDKs. However, the lack of recent updates, community support, and explicit security patching makes it a high-risk dependency for production systems, potentially leading to compatibility issues with newer Node.js versions or security vulnerabilities over time.

Common errors

Warnings

Install

Imports

Quickstart

This code snippet demonstrates how to import the `Akamai` class and generate a basic Akamai authentication token with a configured key and ACL.

import Akamai from 'akamai-auth-token';

const config = {
    algorithm: 'SHA256',
    acl: '/*',
    window: 6000, // Token valid for 6000 seconds (100 minutes)
    key: process.env.AKAMAI_PRIVATE_KEY ?? 'myPrivateKey',
    encoding: false // Set to true if your Akamai configuration requires URL encoding
};

// Ensure you have a private key set in your environment variables or replace 'myPrivateKey'
if (config.key === 'myPrivateKey') {
    console.warn('WARNING: Using a default private key. Please set AKAMAI_PRIVATE_KEY environment variable for production.');
}

try {
    const akamai = new Akamai(config);
    const token = akamai.generateToken();
    console.log('Generated Akamai Token:', token);
} catch (error) {
    console.error('Error generating token:', error.message);
}

view raw JSON →