{"id":18316,"library":"escher-auth","title":"EscherJS","description":"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.","status":"active","version":"4.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/emartech/escher-js","tags":["javascript","escher","js","hmac","sha","aws","signature","http","request"],"install":[{"cmd":"npm install escher-auth","lang":"bash","label":"npm"},{"cmd":"yarn add escher-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add escher-auth","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v4. Use dynamic import if needed in CJS.","wrong":"const Escher = require('escher-auth')","symbol":"Escher","correct":"import { Escher } from 'escher-auth'"},{"note":"For CJS projects, use dynamic import.","wrong":"","symbol":"Escher","correct":"const { Escher } = await import('escher-auth')"},{"note":"AuthError is a named export, not default.","wrong":"import AuthError from 'escher-auth'","symbol":"AuthError","correct":"import { AuthError } from 'escher-auth'"},{"note":"Factory function, named export.","wrong":"import createEscher from 'escher-auth'","symbol":"createEscher","correct":"import { createEscher } from 'escher-auth'"}],"quickstart":{"code":"import { Escher } from 'escher-auth';\n\nconst escher = new Escher({\n  algo: 'SHA256',\n  credentialScope: 'us-east-1/api',\n  accessKeyId: 'your-access-key',\n  apiSecret: 'your-secret-key'\n});\n\n// Sign a request\nconst request = {\n  method: 'POST',\n  url: 'https://api.example.com/data',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({ key: 'value' })\n};\n\nconst signedRequest = escher.signRequest(request);\nconsole.log(signedRequest.headers['X-Escher-Auth']);\n\n// Validate a request\nconst isValid = escher.validateRequest(signedRequest);\nconsole.log('Valid:', isValid);","lang":"typescript","description":"Shows how to create an Escher instance, sign a request, and validate it."},"warnings":[{"fix":"Use import syntax or dynamic import in CJS projects.","message":"Version 4.0.0 is ESM-only, no CommonJS support.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade to v2+ or manually encode parentheses in request URLs.","message":"Version 2.0.0 properly escapes round parentheses in URLs.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Upgrade to v1+ and ensure Node >=6.14.4.","message":"Version 1.0.0 drops Node 0.x support and fixes date handling (date calculated at sign/validate time, not instantiation).","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Use Node >=16 or stick with v3 (supports older Node).","message":"Minimum Node version was raised to 16 in v4.0.0.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use named import { Escher } from 'escher-auth'.","message":"The default export changed; previously could be required as a function.","severity":"gotcha","affected_versions":"<4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import { Escher } from 'escher-auth' or const { Escher } = await import('escher-auth').","cause":"ESM-only module, require returns module namespace object.","error":"const Escher = require('escher-auth'); TypeError: Escher is not a constructor"},{"fix":"Run npm install escher-auth and ensure correct import.","cause":"Package not installed or wrong import path.","error":"Error: Cannot find module 'escher-auth'"},{"fix":"Set algo to 'SHA256' or 'SHA512'.","cause":"Invalid algo parameter passed to constructor.","error":"Escher: algorithm must be one of SHA256, SHA512"},{"fix":"Provide credentialScope as string like 'us-east-1/api'.","cause":"credentialScope missing or malformed.","error":"Escher: credentialScope must be in format 'region/service'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}