Configuration for a Layr8 client.
Fields can be supplied explicitly or resolved from environment variables:
LAYR8_NODE_URL— WebSocket URL of the cloud-nodeLAYR8_API_KEY— authentication keyLAYR8_AGENT_DID— agent DID (optional; ephemeral DID created on connect if absent)
HTTP(S) URLs are automatically normalized to WebSocket scheme:
https://→wss://http://→ws://
Example
config = Layr8.Config.resolve!(%{node_url: "wss://node.example.com/plugin_socket/websocket", api_key: "secret"})
Summary
Functions
Resolves a config map or struct, filling missing fields from environment variables, normalizing the URL scheme, and validating required fields.
Derives the REST API base URL from a WebSocket URL.
Types
Functions
Resolves a config map or struct, filling missing fields from environment variables, normalizing the URL scheme, and validating required fields.
Raises Layr8.Error if required fields are missing.
Derives the REST API base URL from a WebSocket URL.
iex> Layr8.Config.rest_url_from_websocket("wss://node.example.com/plugin_socket/websocket")
"https://node.example.com"
iex> Layr8.Config.rest_url_from_websocket("ws://localhost:4000/plugin_socket/websocket")
"http://localhost:4000"