Layr8 (layr8 v0.2.6)

Copy Markdown View Source

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