{"id":47079,"library":"axios-oauth-1.0a","title":"axios-oauth-1.0a","description":"Add OAuth 1.0a signing to axios requests via interceptors. Current stable version is 0.4.1, updated occasionally. Supports HMAC-SHA1 and HMAC-SHA256 algorithms, auto body hash for POST/PUT, optional realm, callback, verifier, and token secret. Ships TypeScript types, but requires polyfills for buffer and crypto in browsers. Alternative to oauth-1.0a with tighter axios integration, but depends on axios >=0.21.0.","status":"active","version":"0.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/dobesv/axios-oauth-1.0a","tags":["javascript","oauth","axios","typescript"],"install":[{"cmd":"npm install axios-oauth-1.0a","lang":"bash","label":"npm"},{"cmd":"yarn add axios-oauth-1.0a","lang":"bash","label":"yarn"},{"cmd":"pnpm add axios-oauth-1.0a","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; package intercepts axios requests to sign them","package":"axios","optional":false}],"imports":[{"note":"Package exports a default function (ESM default export). CommonJS require also works in Node.js. TypeScript: import type is not provided.","wrong":"const addOAuthInterceptor = require('axios-oauth-1.0a');","symbol":"default","correct":"import addOAuthInterceptor from 'axios-oauth-1.0a';"},{"note":"It is a default export, not named.","wrong":"import { addOAuthInterceptor } from 'axios-oauth-1.0a';","symbol":"addOAuthInterceptor","correct":"import addOAuthInterceptor from 'axios-oauth-1.0a';"},{"note":"OAuthOptions is a TypeScript type (interface), not a runtime value.","wrong":"import { OAuthOptions } from 'axios-oauth-1.0a';","symbol":"OAuthOptions","correct":"import type { OAuthOptions } from 'axios-oauth-1.0a';"}],"quickstart":{"code":"import axios from 'axios';\nimport addOAuthInterceptor from 'axios-oauth-1.0a';\n\nconst client = axios.create();\naddOAuthInterceptor(client, {\n  algorithm: 'HMAC-SHA256',\n  key: process.env.OAUTH_KEY ?? '',\n  secret: process.env.OAUTH_SECRET ?? '',\n  token: process.env.OAUTH_TOKEN ?? '',\n  tokenSecret: process.env.OAUTH_TOKEN_SECRET ?? '',\n  includeBodyHash: 'auto',\n});\n\nclient.get('https://api.example.com/endpoint')\n  .then(response => console.log(response.data))\n  .catch(error => console.error(error));","lang":"typescript","description":"Creates an axios client with OAuth 1.0a interceptor using environment variables for credentials."},"warnings":[{"fix":"Configure resolve.fallback in webpack.config.js: { buffer: require.resolve('buffer/'), crypto: require.resolve('crypto-browserify') } and install packages: npm install buffer crypto-browserify","message":"Requires buffer and crypto polyfills in browser environments (Webpack 5 defaults no polyfills).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set includeBodyHash: true if you need body hash on all methods (e.g., PATCH).","message":"includeBodyHash: 'auto' only hashes body on PUT/POST requests. Other methods will not include body hash regardless of setting.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use algorithm: 'HMAC-SHA256'.","message":"Algorithm 'HMAC-SHA1' is deprecated and considered less secure. Prefer 'HMAC-SHA256'.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Pin to exact version or use lockfile. Check releases for breaking changes.","message":"Package version 0.x may have breaking changes between minor versions. No major release yet.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'-1.0':59 '0.21.0':69 '0.4.1':20 '1.0':4,8 'add':6 'algorithm':31 'altern':56 'auto':32 'axio':2,12,63,68,72 'axios-oauth':1 'bodi':33 'browser':55 'buffer':51 'callback':39 'crypto':53 'current':16 'depend':66 'hash':34 'hmac':25,29 'hmac-sha1':24 'hmac-sha256':28 'integr':64 'interceptor':15 'javascript':70 'oauth':3,7,58,71 'occasion':22 'option':37 'polyfil':49 'post/put':36 'realm':38 'request':13 'requir':48 'secret':43 'sha1':26 'sha256':30 'ship':44 'sign':10 'stabl':17 'support':23 'tighter':62 'token':42 'type':46 'typescript':45,73 'updat':21 'verifi':40 'version':18 'via':14","created_at":"2026-06-07T16:49:40.553509+00:00","updated_at":"2026-06-07T16:49:40.553509+00:00","problems":[{"fix":"Add resolve.fallback for buffer and crypto in webpack config and install buffer and crypto-browserify packages.","cause":"Webpack 5 no longer includes Node.js polyfills by default.","error":"Error: Can't resolve 'buffer' in '/node_modules/axios-oauth-1.0a/dist'"},{"fix":"Ensure you pass an axios instance created via axios.create() or axios for interceptors to be added.","cause":"Passed a regular axios instance or something that is not an axios client with interceptors.","error":"TypeError: client.interceptors.request.use is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/dobesv/axios-oauth-1.0a","github":"https://github.com/dobesv/axios-oauth-1.0a","docs":null,"changelog":null,"pypi":null,"npm":"axios-oauth-1.0a","openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}