Invoke.fromEnv() reads its configuration from the environment. Set these in your deployment platform’s secrets, or in a local .env file that you never commit.
INVOKE_API_KEY
Required. An agent key (recommended) or your account key, from API in the console. See Authentication.
INVOKE_API_URL
The Invoke API. Defaults to https://api.invokehq.run. Only set it to point at another Invoke deployment.
INVOKE_WORKSPACE_ID
Which workspace to act in. By default the SDK uses the one workspace the key can see. An agent key sees only its own. Set this when an account key can see several workspaces; the SDK lists them in a ConfigError if you don’t.
INVOKE_AGENT_ID
The agent that acts when a call doesn’t name one. You don’t need it with an agent key, because the key already is an agent.
In code
Every variable has a matching option.Invoke.fromEnv({ agentId: "billing-agent" }) overrides one variable and reads the rest. new Invoke({ apiKey, baseUrl, workspaceId, agentId }) doesn’t read the environment at all.
Next steps
- Authentication: agent keys and account keys
- TypeScript SDK: the full reference