Autonoma Elixir SDK
Elixir implementation of the Autonoma Environment Factory SDK.
Packages
| Package | Description |
|---|---|
:autonoma | Core protocol (HMAC, refs, graph, handler) |
:autonoma_ecto | Ecto ORM adapter |
:autonoma_plug | Plug server handler |
Quick Start
Install
Add to your mix.exs deps:
defp deps do
[
{:autonoma, path: "path/to/autonoma"},
# optional:
{:autonoma_ecto, path: "path/to/autonoma_ecto"},
{:autonoma_plug, path: "path/to/autonoma_plug"},
]
endPlug + Ecto
# In your router
config = %{
shared_secret: System.get_env("AUTONOMA_SHARED_SECRET"),
signing_secret: System.get_env("AUTONOMA_SIGNING_SECRET"),
adapter: MyApp.AutonomaAdapter,
auth: fn user ->
token = MyApp.Auth.create_session_token(user["id"])
%{"headers" => %{"Authorization" => "Bearer #{token}"}}
end
}
plug Autonoma.Plug.Handler, configCommands
mix deps.get # install dependencies
mix test # run testsDocumentation
For protocol-level documentation, see the root protocol/ directory. For a runnable example, see examples/elixir/phoenix-ecto/.