View Source Hedgex

hex package hex docs ci

Posthog client for Elixir. WIP and highly experimental.

Installation

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

Usage

Configure the API:

config :hedgex,
  public_endpoint: "https://us.i.posthog.com",
  project_api_key: "abcde12345"

Use to make requests:

iex> Hedgex.capture(%{event: "foo_created", distinct_id: "user_12345"})
:ok

# or provide creds dynamically
iex(1)> Hedgex.capture(
...(1)>   %{event: "foo_created", distinct_id: "user_12345", properties: %{}},
...(1)>   hedgex: Hedgex.Env.new(public_endpoint: "...", project_api_key: "...")
...(1)> )
:ok

Documentation

Latest HexDocs

FAQs

Is it any good?

Yes.