Hairfilter SDK for Elixir

hairfilter_sdk is the official Elixir SDK skeleton for the HairFilter API. It provides a clean, publish-ready foundation for the official client while the platform is still in MVP.

The package is intentionally small and opinionated:

Installation

Add the dependency to your mix.exs:

def deps do
  [
    {:hairfilter_sdk, "~> 0.1.0"}
  ]
end

Then fetch dependencies:

mix deps.get

Quick Start

client =
  HairfilterSDK.new(
    api_key: System.fetch_env!("HAIRFILTER_API_KEY")
  )

{:ok, response} =
  HairfilterSDK.get(client, "/v1/health")

response.status
response.body

Configuration

The client accepts these options:

Example:

client =
  HairfilterSDK.new(
    api_key: System.fetch_env!("HAIRFILTER_API_KEY"),
    base_url: "https://hairfilter.net",
    headers: [{"x-sdk-name", "hairfilter-elixir"}],
    receive_timeout: 15_000
  )

Request Examples

GET request:

HairfilterSDK.get(client, "/v1/images", params: %{limit: 10})

POST request:

HairfilterSDK.post(client, "/v1/jobs", body: %{image_url: "https://example.com/me.png"})

Generic request:

HairfilterSDK.request(client, :patch, "/v1/profile", body: %{display_name: "Taylor"})

Publishing Notes

Before the first public release, update these items:

Official Links

License

MIT