@aikagi/runtime
Load your aikagi keys into a running app at start-up. Nothing is copied into your hosting provider.
- Vercel: uses the deployment's OIDC token. No key is stored on Vercel.
- Cloudflare Workers / Pages: uses one read-only key (
AIKAGI_KEY) thataikagi initputs there for you.
Values are fetched once per instance and kept in memory. If aikagi cannot be reached, start-up fails instead of running with missing values.
Set up
In your repository, run aikagi init. It finds .vercel/project.json or your wrangler config and connects the project.
Next.js on Vercel
// instrumentation.ts
import { loadAikagi } from '@aikagi/runtime'
export async function register() {
await loadAikagi()
}
Cloudflare Workers
import { withAikagi } from '@aikagi/runtime'
export default withAikagi({
async fetch(request, env) {
return new Response(env.DATABASE_URL ? 'ok' : 'missing')
},
})
Every fetch shows up in the project's access history in aikagi.
License
MIT