mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-24 00:22:25 +02:00
12 lines
367 B
TypeScript
12 lines
367 B
TypeScript
export function getEnvironmentVariable(name: string): string | undefined {
|
|
// Certain setups (Deno, frontend) will throw an error if you try to access environment variables
|
|
try {
|
|
return typeof process !== "undefined"
|
|
? // eslint-disable-next-line no-process-env
|
|
process.env?.[name]
|
|
: undefined;
|
|
} catch (e) {
|
|
return undefined;
|
|
}
|
|
}
|