mirror of
https://github.com/run-llama/template-workflow-classify-extract-sec.git
synced 2026-07-01 21:54:02 -04:00
Wire PUBLIC_LLAMA_CLOUD_API_KEY through template Vite configs (#273)
Read the opt-in PUBLIC_LLAMA_CLOUD_API_KEY env var and re-export as import.meta.env.VITE_LLAMA_CLOUD_API_KEY for the 5 llama_cloud=true UIs. Server-only LLAMA_CLOUD_API_KEY is no longer the source for client bundles; deployers must explicitly opt in by setting PUBLIC_*.
This commit is contained in:
@@ -10,6 +10,7 @@ export default defineConfig(({}) => {
|
||||
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
|
||||
const serverPort = process.env.LLAMA_DEPLOY_SERVER_PORT;
|
||||
const baseUrl = process.env.LLAMA_CLOUD_BASE_URL;
|
||||
const apiKey = process.env.PUBLIC_LLAMA_CLOUD_API_KEY;
|
||||
return {
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
@@ -43,6 +44,9 @@ export default defineConfig(({}) => {
|
||||
...(baseUrl && {
|
||||
"import.meta.env.VITE_LLAMA_CLOUD_BASE_URL": JSON.stringify(baseUrl),
|
||||
}),
|
||||
...(apiKey && {
|
||||
"import.meta.env.VITE_LLAMA_CLOUD_API_KEY": JSON.stringify(apiKey),
|
||||
}),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user