{"_id":"@akeyless-community/heroku-runtime","name":"@akeyless-community/heroku-runtime","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@akeyless-community/heroku-runtime","version":"0.1.0","description":"Fetch Akeyless secrets at runtime on Heroku dynos (Node.js) — no config-var sync required","license":"Apache-2.0","author":{"name":"Akeyless Community"},"repository":{"type":"git","url":"git+https://github.com/akeyless-community/heroku-akeyless-runtime.git"},"homepage":"https://github.com/akeyless-community/heroku-akeyless-runtime#readme","keywords":["akeyless","heroku","secrets","runtime","config-vars","dyno"],"engines":{"node":">=18"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","prepublishOnly":"npm run build && npm test","example:install":"npm run build && cd examples/express && npm install","example:start":"npm run example:install && cd examples/express && npm start"},"publishConfig":{"access":"public"},"dependencies":{"akeyless":"^5.0.25","akeyless-cloud-id":"^1.0.0"},"devDependencies":{"@types/jest":"^29.5.14","@types/node":"^20.17.0","jest":"^29.7.0","ts-jest":"^29.2.5","typescript":"^5.7.2"},"_id":"@akeyless-community/heroku-runtime@0.1.0","bugs":{"url":"https://github.com/akeyless-community/heroku-akeyless-runtime/issues"},"_nodeVersion":"26.3.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-quScbTPWJvolVZWwjeuPh1Y+cFgnDfcYXNka1vHTzWV3C7uyF/hjm3Zs5fgEe3WmqEsC1fJ8yqAns3zarnKV1Q==","shasum":"7f41b3caa6cab2e4d8e3152a8d47e7ae439e0fbc","tarball":"https://registry.npmjs.org/@akeyless-community/heroku-runtime/-/heroku-runtime-0.1.0.tgz","fileCount":31,"unpackedSize":68878,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2VzqqXMd7HZxaDlc6HbKIsamUHOUTGg9IkumOK7s/nQIhAOM+s06NU09WlQmu8qzQ8dQeC3SsrVPj6vLeQNoBhmwm"}]},"_npmUser":{"name":"barak-akeyless","email":"barak.a@akeyless.io"},"directories":{},"maintainers":[{"name":"barak-akeyless","email":"barak.a@akeyless.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/heroku-runtime_0.1.0_1781505396520_0.8535836306370832"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T06:36:36.315Z","0.1.0":"2026-06-15T06:36:36.658Z","modified":"2026-06-15T06:36:37.008Z"},"maintainers":[{"name":"barak-akeyless","email":"barak.a@akeyless.io"}],"description":"Fetch Akeyless secrets at runtime on Heroku dynos (Node.js) — no config-var sync required","homepage":"https://github.com/akeyless-community/heroku-akeyless-runtime#readme","keywords":["akeyless","heroku","secrets","runtime","config-vars","dyno"],"repository":{"type":"git","url":"git+https://github.com/akeyless-community/heroku-akeyless-runtime.git"},"author":{"name":"Akeyless Community"},"bugs":{"url":"https://github.com/akeyless-community/heroku-akeyless-runtime/issues"},"license":"Apache-2.0","readme":"# @akeyless-community/heroku-runtime\n\nFetch [Akeyless](https://www.akeyless.io) secrets at **runtime** on [Heroku](https://www.heroku.com) dynos (Node.js). Application secrets stay in Akeyless — only bootstrap auth config vars are set on the app.\n\nWorks standalone or with the [Akeyless Heroku add-on](../heroku-akeyless-addon) (`heroku addons:create akeyless`).\n\n## Install\n\n```bash\nnpm install @akeyless-community/heroku-runtime\n```\n\nRequires **Node.js 18+**.\n\n## Quick start\n\n### 1. Provision the add-on (recommended)\n\n```bash\nheroku addons:create akeyless:starter -a my-app\n```\n\nThe add-on injects bootstrap config vars (auth + path prefix). Store application secrets in Akeyless:\n\n```\n/heroku/my-app/production/DATABASE_URL\n/heroku/my-app/production/STRIPE_SECRET_KEY\n```\n\n### 2. Fetch secrets in your app\n\n```javascript\nconst express = require('express');\nconst { getSecret } = require('@akeyless-community/heroku-runtime');\n\nconst app = express();\n\napp.get('/health', async (_req, res) => {\n  const dbUrl = await getSecret('DATABASE_URL');\n  res.json({ ok: true, hasDb: Boolean(dbUrl) });\n});\n\napp.listen(process.env.PORT || 3000);\n```\n\nUse `getSecret` only in **server** code (web dynos, workers, one-off dynos). Never expose fetched secrets to the browser.\n\n### 3. Manual setup (without add-on)\n\nSet bootstrap config vars yourself:\n\n| Config var | Required | Example |\n|------------|----------|---------|\n| `AKEYLESS_ACCESS_ID` | Yes* | `p-xxxxx` |\n| `AKEYLESS_ACCESS_KEY` | Yes* | access key secret |\n| `AKEYLESS_SECRET_PREFIX` | Recommended | `/heroku/my-app/production` |\n| `AKEYLESS_GATEWAY_URL` | No | `https://api.akeyless.io` |\n\n\\* Or use another [auth method](#authentication) below.\n\nIf `AKEYLESS_SECRET_PREFIX` is omitted, the library derives it from Heroku metadata:\n\n```\n/heroku/{HEROKU_APP_NAME}/{HEROKU_APP_ENV}\n```\n\n## Per-environment prefixes\n\n| Heroku environment | Typical prefix |\n|--------------------|----------------|\n| production | `/heroku/my-app/production` |\n| staging | `/heroku/my-app/staging` |\n| review apps | `/heroku/my-app/review` |\n\nSet `AKEYLESS_SECRET_PREFIX` explicitly when you need a custom layout.\n\n## API\n\n### Convenience (singleton, dyno-friendly)\n\n```javascript\nconst { getSecret, getDefaultClient } = require('@akeyless-community/heroku-runtime');\n\nconst dbUrl = await getSecret('DATABASE_URL');\n```\n\n### Explicit client\n\n```javascript\nconst { createClient } = require('@akeyless-community/heroku-runtime');\n\nconst client = createClient({\n  gatewayUrl: 'https://api.akeyless.io',\n  secretPrefix: '/heroku/my-app/production',\n  accessId: process.env.AKEYLESS_ACCESS_ID,\n  accessKey: process.env.AKEYLESS_ACCESS_KEY,\n});\n\nawait client.getSecret('DATABASE_URL');\nawait client.getSecretAtPath('/custom/full/path');\nawait client.getDynamicSecret('db-creds');\nawait client.getRotatedSecret('rotated-api-key');\n```\n\n## Authentication\n\nConfigure via Heroku config vars or `createClient({ ... })`.\n\n| Method | `AKEYLESS_ACCESS_TYPE` | Additional config |\n|--------|------------------------|-------------------|\n| Access key (default) | `access_key` | `AKEYLESS_ACCESS_ID`, `AKEYLESS_ACCESS_KEY` |\n| API key | `api_key` | `AKEYLESS_ACCESS_ID`, `AKEYLESS_ACCESS_KEY` |\n| Universal Identity | `universal_identity` | `AKEYLESS_UID_TOKEN` |\n| JWT | `jwt` | `AKEYLESS_ACCESS_ID`, `AKEYLESS_JWT` |\n| AWS IAM | `aws_iam` | `AKEYLESS_ACCESS_ID`, optional `AKEYLESS_CLOUD_ID` |\n| Pre-authenticated | — | `AKEYLESS_TOKEN` |\n\nUse a dedicated Akeyless auth method with **read-only** access to your `/heroku/...` path.\n\n## Add-on config var prefix\n\nHeroku add-ons expose config vars with a prefix (default: `AKEYLESS_`). If you attach the add-on with a custom prefix:\n\n```bash\nheroku addons:create akeyless:starter --as SECRETS -a my-app\n```\n\nSet `AKEYLESS_ADDON_PREFIX=SECRETS` so the runtime reads `SECRETS_ACCESS_ID`, etc.\n\n## Caching\n\n- **Auth tokens** refresh before expiry (default margin: 1 minute).\n- **Secret values** cache in memory for **5 minutes** by default (`AKEYLESS_SECRET_CACHE_TTL_MS`).\n- Long-lived web/worker dynos reuse the module singleton.\n\nLower TTL or use `ignoreCache: true` for frequently rotated secrets.\n\n## Example app\n\n```bash\nnpm run build\ncd examples/express && npm install\nheroku local  # or set AKEYLESS_* env vars locally\nnpm start\n```\n\n## Local development\n\n```bash\nexport AKEYLESS_ACCESS_ID=p-xxxxx\nexport AKEYLESS_ACCESS_KEY=your-key\nexport AKEYLESS_SECRET_PREFIX=/heroku/my-app/development\nexport HEROKU_APP_NAME=my-app\nexport HEROKU_APP_ENV=development\n```\n\nOr use [Heroku Local](https://devcenter.heroku.com/articles/heroku-local):\n\n```bash\nheroku config -s -a my-app > .env\n```\n\n## Related community projects\n\n- [heroku-akeyless-addon](../heroku-akeyless-addon) — Heroku Elements add-on partner API\n- [@akeyless-community/vercel-runtime](../vercel-akeyless-runtime) — Vercel runtime secrets\n- [@akeyless-community/railway-runtime](../railway-akeyless-runtime) — Railway runtime secrets\n- [buildkite-akeyless-plugin](../buildkite-akeyless-plugin) — CI secret injection\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md","_rev":"1-b9626ab7a2f2092cc6e59f2773450e11"}