Registry / auth-security / escher-auth

escher-auth

JSON →
library4.0.2jsnpmunverified

EscherJS is a JavaScript implementation of the Escher HTTP request signing algorithm, based on Amazon's AWS Signature Version 4 but generalized and extended. Version 4.0.2 (stable, released 2023) supports Node >=16 and is ESM-only. It provides both client and server-side signing and validation of HTTP requests. Key differentiators: it's the reference JS library for the Escher auth protocol, used in production by multiple companies. The library has a history of breaking changes (v2, v3, v4) with updated minimum Node versions and URL encoding fixes.

npm install escher-auth
INSTALL
IMPORT
SIG · ESCHER-AUTH
E
escher-auth
auth-securityjavascriptv4.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Escher
import { Escher } from 'escher-auth'
const Escher = require('escher-auth')
ESM-only since v4. Use dynamic import if needed in CJS.
Escher
const { Escher } = await import('escher-auth')
For CJS projects, use dynamic import.
AuthError
import { AuthError } from 'escher-auth'
import AuthError from 'escher-auth'
AuthError is a named export, not default.
createEscher
import { createEscher } from 'escher-auth'
import createEscher from 'escher-auth'
Factory function, named export.

Shows how to create an Escher instance, sign a request, and validate it.

import { Escher } from 'escher-auth'; const escher = new Escher({ algo: 'SHA256', credentialScope: 'us-east-1/api', accessKeyId: 'your-access-key', apiSecret: 'your-secret-key' }); // Sign a request const request = { method: 'POST', url: 'https://api.example.com/data', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ key: 'value' }) }; const signedRequest = escher.signRequest(request); console.log(signedRequest.headers['X-Escher-Auth']); // Validate a request const isValid = escher.validateRequest(signedRequest); console.log('Valid:', isValid);
Debug
Known issues
breakingVersion 4.0.0 is ESM-only, no CommonJS support.
fix
Use import syntax or dynamic import in CJS projects.
affects: >=4.0.0
breakingVersion 2.0.0 properly escapes round parentheses in URLs.
fix
Upgrade to v2+ or manually encode parentheses in request URLs.
affects: <2.0.0
breakingVersion 1.0.0 drops Node 0.x support and fixes date handling (date calculated at sign/validate time, not instantiation).
fix
Upgrade to v1+ and ensure Node >=6.14.4.
affects: <1.0.0
breakingMinimum Node version was raised to 16 in v4.0.0.
fix
Use Node >=16 or stick with v3 (supports older Node).
affects: >=4.0.0
gotchaThe default export changed; previously could be required as a function.
fix
Use named import { Escher } from 'escher-auth'.
affects: <4.0.0
Errors
Common errors & fixes
const Escher = require('escher-auth'); TypeError: Escher is not a constructor
ESM-only module, require returns module namespace object.
fix
Use import { Escher } from 'escher-auth' or const { Escher } = await import('escher-auth').
Error: Cannot find module 'escher-auth'
Package not installed or wrong import path.
fix
Run npm install escher-auth and ensure correct import.
Escher: algorithm must be one of SHA256, SHA512
Invalid algo parameter passed to constructor.
fix
Set algo to 'SHA256' or 'SHA512'.
Escher: credentialScope must be in format 'region/service'
credentialScope missing or malformed.
fix
Provide credentialScope as string like 'us-east-1/api'.
Upgrade
Version history
4.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
escher-auth — npm install escher-auth · libregistry