Elixir SDK for the Layr8 decentralized identity-native messaging network.
Layr8 enables agents to communicate over DIDComm v2 via a Phoenix Channel WebSocket connection to a Layr8 cloud-node.
Quick Start
{:ok, client} = Layr8.Client.start_link(%{
node_url: "wss://node.example.com/plugin_socket/websocket",
api_key: System.fetch_env!("LAYR8_API_KEY")
})
Layr8.Client.handle(client, "https://example.com/echo/1.0/request", fn msg ->
{:reply, %Layr8.Message{
type: "https://example.com/echo/1.0/response",
body: msg.body
}}
end)
:ok = Layr8.Client.connect(client)Configuration
See Layr8.Config for configuration options and environment variables.
Modules
Layr8.Client— main entry point, GenServer lifecycleLayr8.Config— configuration resolution and URL normalizationLayr8.Message— DIDComm message struct, marshal/parseLayr8.Handler— handler registryLayr8.Channel— Phoenix Channel WebSocket transportLayr8.REST— HTTP client for REST APILayr8.Credentials— W3C Verifiable Credential operationsLayr8.Presentations— W3C Verifiable Presentation operationsLayr8.Errorand friends — exception types