{"_id":"@akeyless-community/fly-runtime","name":"@akeyless-community/fly-runtime","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@akeyless-community/fly-runtime","version":"0.1.0","description":"Fetch Akeyless secrets at runtime on Fly.io Machines (Node.js) — no secret sync required","license":"Apache-2.0","author":{"name":"Akeyless Community"},"repository":{"type":"git","url":"git+https://github.com/akeyless-community/fly-runtime.git"},"homepage":"https://github.com/akeyless-community/fly-runtime#readme","keywords":["akeyless","fly","fly.io","secrets","runtime","environment-variables","paas"],"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"},"gitHead":"e012c496a854b3bb16d44858d52df25b35dd4baf","_id":"@akeyless-community/fly-runtime@0.1.0","bugs":{"url":"https://github.com/akeyless-community/fly-runtime/issues"},"_nodeVersion":"26.3.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-xvDjFc0ilqjqUORxwTrxLbKu2/sYZlDjziWRRT+Rv98EPjISOZWTFoFmwNhhnRLnrRyM3zckewNGE9PECIZ2ig==","shasum":"3159d97a8fab5b1d31b1ea3b4623b5be229c703b","tarball":"https://registry.npmjs.org/@akeyless-community/fly-runtime/-/fly-runtime-0.1.0.tgz","fileCount":31,"unpackedSize":71471,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDsQ0n2oVXsK7WrqKCA1wuIGMEUevpDUkVP+4NWLum2hAiAJiIIiLsKtplnQbpYGoRmzv2kQcbLvhXhgFXiENI8R1A=="}]},"_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/fly-runtime_0.1.0_1781512380790_0.22010541909860382"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T08:33:00.665Z","0.1.0":"2026-06-15T08:33:00.926Z","modified":"2026-06-15T08:33:01.123Z"},"maintainers":[{"name":"barak-akeyless","email":"barak.a@akeyless.io"}],"description":"Fetch Akeyless secrets at runtime on Fly.io Machines (Node.js) — no secret sync required","homepage":"https://github.com/akeyless-community/fly-runtime#readme","keywords":["akeyless","fly","fly.io","secrets","runtime","environment-variables","paas"],"repository":{"type":"git","url":"git+https://github.com/akeyless-community/fly-runtime.git"},"author":{"name":"Akeyless Community"},"bugs":{"url":"https://github.com/akeyless-community/fly-runtime/issues"},"license":"Apache-2.0","readme":"# @akeyless-community/fly-runtime\n\nFetch [Akeyless](https://www.akeyless.io) secrets at **runtime** on [Fly.io](https://fly.io) Machines (Node.js). Application secrets stay in Akeyless — only bootstrap auth variables are stored on Fly.\n\n**Repository:** [github.com/akeyless-community/fly-runtime](https://github.com/akeyless-community/fly-runtime)\n\n## Install\n\n```bash\nnpm install @akeyless-community/fly-runtime\n```\n\nRequires **Node.js 18+**.\n\n## Quick start\n\n### 1. Set bootstrap secrets on Fly.io\n\nStore read-only Akeyless credentials as Fly secrets (or in `[env]` in `fly.toml` for non-sensitive bootstrap values):\n\n```bash\nfly secrets set \\\n  AKEYLESS_ACCESS_ID=p-xxxxx \\\n  AKEYLESS_ACCESS_KEY=your-access-key \\\n  AKEYLESS_SECRET_PREFIX=/fly/my-app/production\n```\n\n| Variable | Required | Example |\n|----------|----------|---------|\n| `AKEYLESS_ACCESS_ID` | Yes* | `p-xxxxx` |\n| `AKEYLESS_ACCESS_KEY` | Yes* | access key secret |\n| `AKEYLESS_SECRET_PREFIX` | Recommended | `/fly/my-app/production` |\n| `AKEYLESS_GATEWAY_URL` | No | `https://api.akeyless.io` |\n| `FLY_ENV` or `AKEYLESS_ENV` | No | `staging` (used when prefix is derived) |\n\n\\* Or use another [auth method](#authentication) below.\n\nIf `AKEYLESS_SECRET_PREFIX` is omitted, the library derives it from Fly metadata:\n\n```\n/fly/{FLY_APP_NAME}/{FLY_ENV or AKEYLESS_ENV or production}\n```\n\nFly sets `FLY_APP_NAME`, `FLY_REGION`, and `FLY_PROCESS_GROUP` automatically on every Machine. See the [Fly runtime environment](https://fly.io/docs/machines/runtime-environment/).\n\n### 2. Store application secrets in Akeyless\n\n```\n/fly/my-app/production/DATABASE_URL\n/fly/my-app/production/STRIPE_SECRET_KEY\n```\n\nFor multi-process apps, either use a shared app/env prefix or opt into per-process-group prefixes:\n\n```bash\nfly secrets set AKEYLESS_INCLUDE_PROCESS_GROUP_IN_PREFIX=true\n# → /fly/my-app/production/worker/DATABASE_URL\n```\n\n### 3. Fetch secrets in your app\n\n```javascript\nconst express = require('express');\nconst { getSecret } = require('@akeyless-community/fly-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. Never expose fetched secrets to the browser.\n\n## Per-environment prefixes\n\n| Fly environment | Typical prefix |\n|-----------------|----------------|\n| production | `/fly/my-app/production` |\n| staging | `/fly/my-app/staging` |\n| development | `/fly/my-app/development` |\n\nSet `FLY_ENV` or `AKEYLESS_ENV` on each Fly app, or set `AKEYLESS_SECRET_PREFIX` explicitly when you need a custom layout.\n\nMany teams use separate Fly apps per environment (`my-app-staging`, `my-app-prod`) with the default `production` segment — both patterns work.\n\n## API\n\n### Convenience (singleton, replica-friendly)\n\n```javascript\nconst { getSecret, getDefaultClient } = require('@akeyless-community/fly-runtime');\n\nconst dbUrl = await getSecret('DATABASE_URL');\n```\n\n### Explicit client\n\n```javascript\nconst { createClient } = require('@akeyless-community/fly-runtime');\n\nconst client = createClient({\n  gatewayUrl: 'https://api.akeyless.io',\n  secretPrefix: '/fly/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 Fly secrets / `[env]` or `createClient({ ... })`.\n\n| Method | `AKEYLESS_ACCESS_TYPE` | Additional variables |\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 `/fly/...` path.\n\n## Local development with Fly CLI\n\nRun your app locally with the same secrets as your Fly app:\n\n```bash\nfly secrets list\nfly secrets import < .env.local   # optional: sync local env file\nfly proxy 3000:3000               # if your app needs Fly-internal services\n```\n\nOr export variables manually:\n\n```bash\nexport AKEYLESS_ACCESS_ID=p-xxxxx\nexport AKEYLESS_ACCESS_KEY=your-key\nexport AKEYLESS_SECRET_PREFIX=/fly/my-app/development\nexport FLY_APP_NAME=my-app\nexport FLY_ENV=development\n```\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 Fly Machines reuse the module singleton.\n\nLower TTL or use `ignoreCache: true` for frequently rotated secrets.\n\n## Push sync vs runtime pull\n\n| Pattern | When to use |\n|---------|-------------|\n| **Runtime pull** (this package) | Akeyless stays source of truth; only bootstrap creds on Fly |\n| **Push sync** | Copy secrets into Fly secrets (future Akeyless Destination Sync or CI) |\n\nRuntime pull works today without any Fly marketplace listing.\n\n## Example app\n\n```bash\nnpm run build\ncd examples/express && npm install\nnpm start\n```\n\nSet `AKEYLESS_*` env vars before starting.\n\n## Publishing\n\nThis package is Apache-2.0 and published as `@akeyless-community/fly-runtime` on npm.\n\nTo publish from a standalone clone:\n\n```bash\nnpm ci\nnpm test\nnpm publish --access public\n```\n\n## Related community projects\n\n- [@akeyless-community/vercel-runtime](https://github.com/akeyless-community/vercel-runtime) — Vercel runtime secrets\n- [@akeyless-community/netlify-runtime](https://github.com/akeyless-community/netlify-runtime) — Netlify runtime secrets\n- [@akeyless-community/heroku-runtime](https://github.com/akeyless-community/heroku-runtime) — Heroku runtime secrets\n- [@akeyless-community/railway-runtime](https://github.com/akeyless-community/railway-runtime) — Railway runtime secrets\n- [buildkite-akeyless-plugin](https://github.com/akeyless-community/buildkite-akeyless-plugin) — CI secret injection\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md","_rev":"1-55a37bf77b3316b0967a85bd10327218"}