lomavuokraus/lib/apiKeys.ts
Tero Halla-aho 0bb709d9c5
Some checks failed
CI / checks (push) Has been cancelled
chore: fix audit alerts and formatting
2026-02-04 12:43:03 +02:00

12 lines
334 B
TypeScript

import fs from "fs";
import path from "path";
export function loadN8nBillingApiKey() {
if (process.env.N8N_BILLING_API_KEY) return process.env.N8N_BILLING_API_KEY;
const keyPath = path.join(process.cwd(), "creds", "n8n-billing.key");
try {
return fs.readFileSync(keyPath, "utf8").trim();
} catch {
return null;
}
}