Files
langgraph/libs/sdk-js/docs/functions/getApiKey.md
T
2025-07-07 08:05:46 -07:00

634 B

@langchain/langgraph-sdk


@langchain/langgraph-sdk / getApiKey

Function: getApiKey()

getApiKey(apiKey?): undefined | string

Defined in: client.ts:122

Get the API key from the environment. Precedence:

  1. explicit argument
  2. LANGGRAPH_API_KEY
  3. LANGSMITH_API_KEY
  4. LANGCHAIN_API_KEY

Parameters

apiKey?

string

Optional API key provided as an argument

Returns

undefined | string

The API key if found, otherwise undefined