© 2026 Hedgehog Software, LLC
const h = c.req.raw.headers.get("x-api-key") || ""; const verify = await auth.api.verifyApiKey({ body: { key: h, }, }); console.log({ verify }); const session = await auth.api.getSession({ headers: new Headers({ "x-api-key": h.trim(), }), }); console.log({ session });
{ verify: { valid: true, error: null, key: { name: 'test', start: 'ANoPxW', prefix: null, userId: 'l2spq7at27gddtswrq3c35vb', refillInterval: null, refillAmount: null, lastRefillAt: null, enabled: true, rateLimitEnabled: true, rateLimitTimeWindow: 86400000, rateLimitMax: 5000, requestCount: 8, remaining: null, lastRequest: 2025-10-22T06:21:28.555Z, expiresAt: null, createdAt: 2025-10-22T05:29:49.481Z, updatedAt: 2025-10-22T05:29:49.481Z, permissions: [Object], metadata: null, id: 'f5ng3ajbc2u4mtbv1av5x2uh' } } }
{ session: null }