{"name":"@aws-sdk/credential-provider-node","version":"3.946.0","keywords":["aws","credentials"],"author":{"url":"https://aws.amazon.com/javascript/","name":"AWS SDK for JavaScript Team"},"license":"Apache-2.0","_id":"@aws-sdk/credential-provider-node@3.946.0","maintainers":[{"name":"amzn-oss","email":"osa-3p@amazon.com"},{"name":"aws-sdk-bot","email":"aws-sdk-js-automation@amazon.com"}],"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-provider-node","bugs":{"url":"https://github.com/aws/aws-sdk-js-v3/issues"},"dist":{"shasum":"c544df6010abf2c609ab7e44de872dc663e7db02","tarball":"http://registry-npm.ywwl.com/@aws-sdk/credential-provider-node/download/@aws-sdk/credential-provider-node-3.946.0.tgz","fileCount":16,"integrity":"sha512-I7URUqnBPng1a5y81OImxrwERysZqMBREG6svhhGeZgxmqcpAZ8z5ywILeQXdEOCuuES8phUp/ojzxFjPXp/eA==","signatures":[{"sig":"MEUCICWfu9zTeHLlsS6IBhFigOh/vRjaXN7ozybA5xQoh+YEAiEA9zVkowRWl0zziELMSfLsy8ovNBalRXgjyYStL4u1kSA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39472,"size":9805,"noattachment":false,"key":"/@aws-sdk/credential-provider-node/-/@aws-sdk/credential-provider-node-3.946.0.tgz"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","engines":{"node":">=18.0.0"},"scripts":{"test":"yarn g:vitest run --reporter verbose","build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","build:es":"tsc -p tsconfig.es.json","build:cjs":"node ../../scripts/compilation/inline credential-provider-node","test:watch":"yarn g:vitest watch","build:types":"tsc -p tsconfig.types.json","test:integration":"yarn g:vitest run -c vitest.config.integ.mts","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","test:integration:watch":"yarn g:vitest watch -c vitest.config.integ.mts"},"_npmUser":{"name":"aws-sdk-bot","email":"aws-sdk-js-automation@amazon.com"},"repository":{"url":"git+https://github.com/aws/aws-sdk-js-v3.git","type":"git","directory":"packages/credential-provider-node"},"_npmVersion":"11.6.2","description":"AWS credential provider that sources credentials from a Node.JS environment. ","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","dependencies":{"tslib":"^2.6.2","@smithy/types":"^4.9.0","@aws-sdk/types":"3.936.0","@smithy/property-provider":"^4.2.5","@smithy/shared-ini-file-loader":"^4.4.0","@aws-sdk/credential-provider-env":"3.946.0","@aws-sdk/credential-provider-ini":"3.946.0","@aws-sdk/credential-provider-sso":"3.946.0","@smithy/credential-provider-imds":"^4.2.5","@aws-sdk/credential-provider-http":"3.946.0","@aws-sdk/credential-provider-process":"3.946.0","@aws-sdk/credential-provider-web-identity":"3.946.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"3.0.2","typescript":"~5.8.3","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","@tsconfig/recommended":"1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/credential-provider-node_3.946.0_1764965101421_0.5658175129505172","host":"s3://npm-registry-packages-npm-production"},"readme":"# @aws-sdk/credential-provider-node\n\n[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-node)\n[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-node.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-node)\n\n## AWS Credential Provider for Node.JS\n\nThis module provides a factory function, `defaultProvider`, that will attempt to\nsource AWS credentials from a Node.JS environment. It will attempt to find\ncredentials from the following sources (listed in order of precedence):\n\n- Environment variables exposed via `process.env`\n- SSO credentials from token cache\n- Web identity token credentials\n- Shared credentials and config ini files\n- The EC2/ECS Instance Metadata Service\n\nThe default credential provider will invoke one provider at a time and only\ncontinue to the next if no credentials have been located. For example, if the\nprocess finds values defined via the `AWS_ACCESS_KEY_ID` and\n`AWS_SECRET_ACCESS_KEY` environment variables, the files at `~/.aws/credentials`\nand `~/.aws/config` will not be read, nor will any messages be sent to the\nInstance Metadata Service.\n\nIf invalid configuration is encountered (such as a profile in\n`~/.aws/credentials` specifying as its `source_profile` the name of a profile\nthat does not exist), then the chained provider will be rejected with an error\nand will not invoke the next provider in the list.\n\n_IMPORTANT_: if you intend to acquire credentials using EKS\n[IAM Roles for Service Accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html),\nthen you must explicitly specify a value for `roleAssumerWithWebIdentity`. There is a\ndefault function available in `@aws-sdk/client-sts` package. An example of using\nthis:\n\n```js\nconst { getDefaultRoleAssumerWithWebIdentity } = require(\"@aws-sdk/client-sts\");\nconst { defaultProvider } = require(\"@aws-sdk/credential-provider-node\");\nconst { S3Client, GetObjectCommand } = require(\"@aws-sdk/client-s3\");\n\nconst provider = defaultProvider({\n  roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity({\n    // You must explicitly pass a region if you are not using us-east-1\n    region: \"eu-west-1\",\n  }),\n});\n\nconst client = new S3Client({ credentialDefaultProvider: provider });\n```\n\n_IMPORTANT_: We provide a wrapper of this provider in `@aws-sdk/credential-providers`\npackage to save you from importing `getDefaultRoleAssumerWithWebIdentity()` or\n`getDefaultRoleAssume()` from STS package. Similarly, you can do:\n\n```js\nconst { fromNodeProviderChain } = require(\"@aws-sdk/credential-providers\");\n\nconst credentials = fromNodeProviderChain();\n\nconst client = new S3Client({ credentials });\n```\n\n## Supported configuration\n\nYou may customize how credentials are resolved by providing an options hash to\nthe `defaultProvider` factory function. The following options are\nsupported:\n\n- `profile` - The configuration profile to use. If not specified, the provider\n  will use the value in the `AWS_PROFILE` environment variable or a default of\n  `default`.\n- `filepath` - The path to the shared credentials file. If not specified, the\n  provider will use the value in the `AWS_SHARED_CREDENTIALS_FILE` environment\n  variable or a default of `~/.aws/credentials`.\n- `configFilepath` - The path to the shared config file. If not specified, the\n  provider will use the value in the `AWS_CONFIG_FILE` environment variable or a\n  default of `~/.aws/config`.\n- `mfaCodeProvider` - A function that returns a a promise fulfilled with an\n  MFA token code for the provided MFA Serial code. If a profile requires an MFA\n  code and `mfaCodeProvider` is not a valid function, the credential provider\n  promise will be rejected.\n- `roleAssumer` - A function that assumes a role and returns a promise\n  fulfilled with credentials for the assumed role. If not specified, no role\n  will be assumed, and an error will be thrown.\n- `roleArn` - ARN to assume. If not specified, the provider will use the value\n  in the `AWS_ROLE_ARN` environment variable.\n- `webIdentityTokenFile` - File location of where the `OIDC` token is stored.\n  If not specified, the provider will use the value in the `AWS_WEB_IDENTITY_TOKEN_FILE`\n  environment variable.\n- `roleAssumerWithWebIdentity` - A function that assumes a role with web identity and\n  returns a promise fulfilled with credentials for the assumed role.\n- `timeout` - The connection timeout (in milliseconds) to apply to any remote\n  requests. If not specified, a default value of `1000` (one second) is used.\n- `maxRetries` - The maximum number of times any HTTP connections should be\n  retried. If not specified, a default value of `0` will be used.\n\n## Related packages:\n\n- [AWS Credential Provider for Node.JS - Environment Variables](../credential-provider-env)\n- [AWS Credential Provider for Node.JS - SSO](../credential-provider-sso)\n- [AWS Credential Provider for Node.JS - Web Identity](../credential-provider-web-identity)\n- [AWS Credential Provider for Node.JS - Shared Configuration Files](../credential-provider-ini)\n- [AWS Credential Provider for Node.JS - Instance and Container Metadata](../credential-provider-imds)\n- [AWS Shared Configuration File Loader](../shared-ini-file-loader)\n","publish_time":1764965101641,"_cnpm_publish_time":1764965101641,"dist-tags":{"alpha":"1.0.0-alpha.7","beta":"1.0.0-beta.4","gamma":"1.0.0-gamma.9","latest":"3.972.93","preview":"0.1.0-preview.10","rc":"3.5.1-rc.0"}}