Files
big-agi/next.config.js
T
Enrico Ros c15b48d1b4 Fix #24: when OPENAI_API_KEY is defined, do not prompt the user
With this simple change, if the key is defined _at build time_,
the user will not be prompted to enter a key, and it will be
marked as 'not required' in the Settings dialog.

Note that this verifies a build-time key (next build), not that
the same key is set at runtime (next start).

The behavior of the UI is just altered slightly, but enough to
show that the key is not required when set on the server.
2023-03-23 22:45:47 -07:00

11 lines
282 B
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
env: {
// defaults to TRUE, unless API Keys are set at build time; this flag is used by the UI
REQUIRE_USER_API_KEYS: !process.env.OPENAI_API_KEY,
},
};
module.exports = nextConfig;