{"_id":"@camunda8/oauth","_rev":"6-85acc3a91c5429e0eafc37a705bcb694","name":"@camunda8/oauth","dist-tags":{"alpha":"8.4.0","latest":"8.4.0"},"versions":{"8.4.0":{"name":"@camunda8/oauth","version":"8.4.0","keywords":[],"author":{"name":"josh.wulf@camunda.com"},"license":"Apache 2.0","_id":"@camunda8/oauth@8.4.0","maintainers":[{"name":"sitapati","email":"josh@magikcraft.io"}],"homepage":"https://github.com/camunda-community-hub/camunda-saas-oauth-nodejs#readme","bugs":{"url":"https://github.com/camunda-community-hub/camunda-saas-oauth-nodejs/issues"},"dist":{"shasum":"adaaa499cb82e4eea535f7ba54b55032e62aa8fa","tarball":"https://registry.npmjs.org/@camunda8/oauth/-/oauth-8.4.0.tgz","fileCount":70,"integrity":"sha512-aMXL+xNRHCtroRRpxxqsJTXA2Q0gx05uNbSC8DvcHWWDe7f1Myib8dWGzIEH4ZK6pDoBaqU5yy3c8EBZhhAtow==","signatures":[{"sig":"MEUCIQCGwlYD22gjCaXOOtIlYEKgjHEltCbLS5X8ye4W+4ZYRgIgFl8byer+RHhw7XX6S3df/dRZC7yL3afmrRmiipe56Bw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121414},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"45b1f93347bbe930d5782287d6821efec95e9a63","private":false,"scripts":{"lint":"eslint . --ext .ts,.tsx","test":"jest --detectOpenHandles --testPathIgnorePatterns integration","build":"npm run clean && npm run compile","clean":"rm -rf ./dist && rm -f ./tsconfig.tsbuildinfo","compile":"tsc --project tsconfig.json","prettify":"prettier --write 'src/**/*.ts'","test:integration":"jest --runInBand --detectOpenHandles --verbose true"},"_npmUser":{"name":"sitapati","email":"josh@magikcraft.io"},"deprecated":"This package is deprecated. Please use the official SDK package @camunda8/sdk. See: https://github.com/camunda/camunda-8-js-sdk","repository":{"url":"git+https://github.com/camunda-community-hub/camunda-8-js-sdk.git","type":"git"},"_npmVersion":"lerna/7.4.2/node@v18.17.1+arm64 (darwin)","description":"A library to exchange a set of Camunda 8 SaaS API credentials for a token","directories":{},"_nodeVersion":"18.17.1","dependencies":{"debug":"^4.3.4","neon-env":"^0.1.1","isomorphic-fetch":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/debug":"^4.1.12"},"_npmOperationalInternal":{"tmp":"tmp/oauth_8.4.0_1706754887172_0.9999256727428609","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-02-01T02:34:47.065Z","modified":"2026-09-16T06:30:08.753Z","8.4.0":"2024-02-01T02:34:47.353Z"},"bugs":{"url":"https://github.com/camunda-community-hub/camunda-saas-oauth-nodejs/issues"},"author":{"name":"josh.wulf@camunda.com"},"license":"Apache 2.0","homepage":"https://github.com/camunda-community-hub/camunda-saas-oauth-nodejs#readme","keywords":[],"repository":{"url":"git+https://github.com/camunda-community-hub/camunda-8-js-sdk.git","type":"git"},"description":"A library to exchange a set of Camunda 8 SaaS API credentials for a token","maintainers":[{"email":"vobu+npmjs@posteo.de","name":"vobu"},{"email":"josh@magikcraft.io","name":"sitapati"},{"email":"emily.oram@camunda.com","name":"emilyoram"},{"email":"jan.ladleif@camunda.com","name":"camunda-jan"},{"email":"pablocabrera1985@gmail.com","name":"pcab"}],"readme":"# Camunda SaaS OAuth for Node.js\n\n [![NPM](https://nodei.co/npm/camunda-saas-oauth.png)](https://npmjs.org/package/camunda-saas-oauth) \n\n![Community Extension](https://img.shields.io/badge/Community%20Extension-An%20open%20source%20community%20maintained%20project-FF4700)\n\n![Lifecycle](https://img.shields.io/badge/Lifecycle-Stable-brightgreen)\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA library to exchange a set of Camunda 8 SaaS API credentials for a token to make API calls to Camunda 8 SaaS. Uses [camunda-8-credentials-from-env](https://github.com/camunda-community-hub/camunda-8-credentials-from-env) to get the credentials from the environment.\n\nCaches the token to disk, and refreshes tokens before they expire.\n\n## Installation\n\nInstall as a dependency:\n\n```\nnpm i camunda-saas-oauth\n```\n\n## Usage \n\n```typescript\nimport * as auth from \"camunda-saas-oauth\"\n\nasync function main () {\n    const useragent = 'myclient-nodejs/1.0.0'\n    const operateToken = await auth.getOperateToken(useragent)\n    const tasklistToken = await auth.getTasklistToken(useragent)\n    const optimizeToken = await auth.getOptimizeToken(useragent)\n    const zeebeToken = await auth.getZeebeToken(useragent)\n    return {\n        operateToken,\n        tasklistToken,\n        optimizeToken,\n        zeebeToken\n    }\n}   \n```\n\nThe call will throw if the client credentials are not found in the environment, or you request a token for a scope for which the credentials are not valid. \n\n## Configuration\n\nSet the API client credentials in the environment, using [the environment variables from the web console](https://docs.camunda.io/docs/components/console/manage-clusters/manage-api-clients/).\n\nTo configure a different cache directory, set the `CAMUNDA_TOKEN_CACHE_DIR` environment variable.\n\nTo turn off disk caching, set the environment variable `CAMUNDA_TOKEN_CACHE=memory-only`.\n\n## User Agent\n\nExample of a custom user agent string: `mycustom-client-nodejs/${pkg.version} ${CUSTOM_AGENT_STRING}`\n\n## Advanced Usage\n\nThe methods that return tokens use an `OAuthProvider` to get the tokens. \n \nThe `OAuthProvider` class is a wrapper that hydrates a `OAuthProviderImpl` with credentials from the environment. \n\nIf you want to manually set the credentials (for example, to address multiple clusters in a single application), you can do so by creating an `OAuthProviderImpl` directly, like so:\n\n```typescript\nimport { OAuthProviderImpl } from 'camunda-saas-oauth'\n\nconst oauth = new OAuthProviderImpl({\n        /** OAuth Endpoint URL */\n        authServerUrl,\n        /** OAuth Audience */\n        audience, clientId, clientSecret,\n        userAgentString\n})\n\nconst operateToken = oauth.getToken('OPERATE')\nconst optimizeToken = oauth.getToken('OPTIMIZE')\nconst tasklistToken = oauth.getToken('TASKLIST')\nconst zeebeToken = oauth.getToken('ZEEBE')\n```\n\n\n","readmeFilename":"README.md"}