{"id":47721,"library":"fuel-auth","title":"Salesforce Marketing Cloud FuelSDK Auth","description":"Node.js library for OAuth2 authentication with Salesforce Marketing Cloud (formerly ExactTarget) REST and SOAP APIs. Version 3.3.0 targets Node >= 4, uses request package for HTTP, and is ESM-only with TypeScript declarations. It simplifies obtaining access tokens using client credentials or refresh tokens. Compared to manual OAuth2 flows, it handles token caching, refresh, and error handling. The library is actively maintained by Salesforce but has limited updates for newer Node versions.","status":"active","version":"3.3.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/salesforce-marketingcloud/FuelSDK-Node-Auth","tags":["javascript"],"install":[{"cmd":"npm install fuel-auth","lang":"bash","label":"npm"},{"cmd":"yarn add fuel-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add fuel-auth","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP client for token requests","package":"request","optional":false}],"imports":[{"note":"ESM-only since v3; no CommonJS default export.","wrong":"const AuthClient = require('fuel-auth')","symbol":"AuthClient","correct":"import { AuthClient } from 'fuel-auth'"},{"note":"Library exports both named and default export for convenience.","wrong":"const auth = new AuthClient(options) // requires import or require","symbol":"default","correct":"import AuthClient from 'fuel-auth'"},{"note":"TypeScript types are exported; use 'import type' to avoid runtime overhead.","wrong":"const AuthClientOptions = require('fuel-auth').AuthClientOptions","symbol":"AuthClient (type)","correct":"import type { AuthClientOptions } from 'fuel-auth'"}],"quickstart":{"code":"import AuthClient from 'fuel-auth';\n\nconst client = new AuthClient({\n  clientId: process.env.MC_CLIENT_ID ?? '',\n  clientSecret: process.env.MC_CLIENT_SECRET ?? '',\n  authUrl: 'https://auth.exacttargetapis.com/v1/requestToken',\n});\n\nclient.getAccessToken()\n  .then((token) => {\n    console.log('Access Token:', token.accessToken);\n  })\n  .catch((err) => {\n    console.error('Auth error:', err.message);\n  });","lang":"typescript","description":"Shows ES module import, instantiation of AuthClient with credentials, and obtaining an access token."},"warnings":[{"fix":"Migrate to a modern HTTP client (e.g., node-fetch, axios) via a wrapper or fork.","message":"request package is deprecated; may cause security vulnerabilities and lack of updates.","severity":"gotcha","affected_versions":">=3.0"},{"fix":"Use import syntax and ensure package.json has 'type': 'module' or use .mjs extension.","message":"Switched from CommonJS (require) to ESM-only in v3. require() will not work.","severity":"breaking","affected_versions":">=3.0"},{"fix":"Update authUrl to 'https://mc.exacttargetapis.com/v1/requestToken' or the correct v2 endpoint.","message":"exacttargetapis.com auth URL is deprecated; use new Salesforce Marketing Cloud endpoints.","severity":"deprecated","affected_versions":">=3.0"},{"fix":"Implement custom cache adapter via the 'cache' option or use a shared cache like Redis.","message":"Default token caching is in-memory and may not be suitable for serverless or multi-process environments.","severity":"gotcha","affected_versions":">=3.0"}],"env_vars":null,"search_vec":"'3.3.0':22 '4':25 'access':42 'activ':66 'api':20 'auth':5 'authent':10 'cach':58 'client':45 'cloud':3,14 'compar':50 'credenti':46 'declar':38 'error':61 'esm':34 'esm-on':33 'exacttarget':16 'flow':54 'former':15 'fuelsdk':4 'handl':56,62 'http':30 'javascript':78 'librari':7,64 'limit':72 'maintain':67 'manual':52 'market':2,13 'newer':75 'node':24,76 'node.js':6 'oauth2':9,53 'obtain':41 'packag':28 'refresh':48,59 'request':27 'rest':17 'salesforc':1,12,69 'simplifi':40 'soap':19 'target':23 'token':43,49,57 'typescript':37 'updat':73 'use':26,44 'version':21,77","created_at":"2026-06-07T16:52:57.965095+00:00","updated_at":"2026-06-07T16:52:57.965095+00:00","problems":[{"fix":"Switch to ES module import syntax or downgrade to v2.x.","cause":"CommonJS require() used on ESM-only package v3+.","error":"Error: Cannot find module 'fuel-auth'"},{"fix":"Use default import: import AuthClient from 'fuel-auth'","cause":"Importing default incorrectly when using named export.","error":"TypeError: AuthClient is not a constructor"},{"fix":"Update authUrl to the correct endpoint for your region.","cause":"Deprecated auth endpoint or misconfigured authUrl.","error":"Error: getaddrinfo ENOTFOUND auth.exacttargetapis.com"},{"fix":"Verify credentials in Salesforce Marketing Cloud setup.","cause":"Invalid clientId/clientSecret or expired/invalid tenant.","error":"Error: Failed to obtain access token: 401 Unauthorized"}],"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/salesforce-marketingcloud/FuelSDK-Node-Auth#readme","github":"ssh://git@github.com/salesforce-marketingcloud/FuelSDK-Node-Auth","docs":null,"changelog":null,"pypi":null,"npm":"fuel-auth","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}}