Bandeira Elixir SDK
Official Elixir client SDK for Bandeira, a self-hosted feature flag service.
Install
Add to mix.exs:
def deps do
[
{:bandeira, "~> 0.1.0"}
]
endThen run:
mix deps.getUsage
alias Bandeira.{Client, Config, Context}
{:ok, client} =
Client.start_link(%Config{
url: "http://localhost:8080",
token: "your-client-token"
})
if Client.is_enabled(client, "my-flag", %Context{user_id: "user-123"}) do
# feature is on
end
Client.close(client)Notes
-
The client polls
/api/v1/flagsin the background and caches flags in memory. is_enabled/3is a pure in-memory lookup and does not do network I/O.- Initial startup fails fast if the first fetch fails.
-
Call
close/1when running unmanaged clients.