{"id":47651,"library":"fetch-secret-identifier","title":"fetch-secret-identifier","description":"Fetches secrets from AWS Secrets Manager by identifier. Current stable version is 0.1.0. Provides both callback-based `getSecretValue` and Promise-based `getSecretValueAsync` APIs. Lightweight wrapper around the AWS SDK with minimal abstraction. Configured via environment variables (`AWS_ACCESS_KEY`, `AWS_SECRET_KEY`, `AWS_REGION`, `SM_REMOTE`). Suitable for Node.js projects needing quick secret retrieval without full AWS SDK setup, though lacks advanced features like caching or automatic retries.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/dongtong/fetch-secret-identifier","tags":["javascript","AWS","Secret Manager","Security"],"install":[{"cmd":"npm install fetch-secret-identifier","lang":"bash","label":"npm"},{"cmd":"yarn add fetch-secret-identifier","lang":"bash","label":"yarn"},{"cmd":"pnpm add fetch-secret-identifier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to interact with AWS Secrets Manager API","package":"aws-sdk","optional":false}],"imports":[{"note":"Package uses CommonJS and does not ship ESM; dynamic import works but is atypical.","wrong":"import sm from 'fetch-secret-identifier';","symbol":"fetch-secret-identifier (default)","correct":"const sm = require('fetch-secret-identifier');"},{"note":"Callback is not promise-based; use getSecretValueAsync for async/await.","wrong":"sm.getSecretValue('id', async (data) => {});","symbol":"getSecretValue","correct":"const sm = require('fetch-secret-identifier'); sm.getSecretValue('id', callback);"},{"note":"Named export works with destructuring or direct property access.","wrong":"const sm = require('fetch-secret-identifier'); sm.getSecretValueAsync().then();","symbol":"getSecretValueAsync","correct":"const { getSecretValueAsync } = require('fetch-secret-identifier');"}],"quickstart":{"code":"const sm = require('fetch-secret-identifier');\n\n// using callback\nsm.getSecretValue('my-secret-id', (data) => {\n  console.log('Secret:', data);\n});\n\n// using async/await\n(async () => {\n  try {\n    const secret = await sm.getSecretValueAsync('my-secret-id');\n    console.log('Secret:', secret);\n  } catch (err) {\n    console.error('Error:', err);\n  }\n})();","lang":"javascript","description":"Shows both callback and async/await usage to fetch a secret by identifier from AWS Secrets Manager."},"warnings":[{"fix":"Set both environment variables before calling any function.","message":"Requires environment variables AWS_ACCESS_KEY and AWS_SECRET_KEY; missing them causes silent failures.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set SM_REMOTE=true in environment when deploying to AWS.","message":"SM_REMOTE=true is needed to actually call AWS Secrets Manager; default behavior may be local fallback or no-op.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Create manual .d.ts or use `@ts-ignore`.","message":"No TypeScript type definitions shipped; TypeScript users will get implicit any.","severity":"breaking","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.1.0':17 'abstract':38 'access':44 'advanc':68 'api':29 'around':32 'automat':73 'aw':8,34,43,46,49,63,76 'base':22,27 'cach':71 'callback':21 'callback-bas':20 'configur':39 'current':13 'environ':41 'featur':69 'fetch':2,5 'fetch-secret-identifi':1 'full':62 'getsecretvalu':23 'getsecretvalueasync':28 'identifi':4,12 'javascript':75 'key':45,48 'lack':67 'lightweight':30 'like':70 'manag':10,78 'minim':37 'need':57 'node.js':55 'project':56 'promis':26 'promise-bas':25 'provid':18 'quick':58 'region':50 'remot':52 'retri':74 'retriev':60 'sdk':35,64 'secret':3,6,9,47,59,77 'secur':79 'setup':65 'sm':51 'stabl':14 'suitabl':53 'though':66 'variabl':42 'version':15 'via':40 'without':61 'wrapper':31","created_at":"2026-06-07T16:52:36.415515+00:00","updated_at":"2026-06-07T16:52:36.415515+00:00","problems":[{"fix":"Use const sm = require('fetch-secret-identifier');","cause":"Importing incorrectly (e.g., using ESM import syntax without transpilation).","error":"TypeError: sm.getSecretValue is not a function"},{"fix":"Set AWS_REGION=us-west-2 (or your region) in environment.","cause":"AWS_REGION environment variable not set.","error":"Missing region in config"},{"fix":"Attach AWSSecretsManagerReadWrite policy to the IAM user/role.","cause":"AWS credentials lack permissions for the secret.","error":"AccessDeniedException: User: arn:aws:iam::xxx is not authorized to perform: secretsmanager:GetSecretValue"}],"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/dongtong/fetch-secret-identifier#readme","github":"https://github.com/dongtong/fetch-secret-identifier","docs":null,"changelog":null,"pypi":null,"npm":"fetch-secret-identifier","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}}