View Source Hedgex

hex package hex docs ci

Posthog client for Elixir. WIP and highly experimental.

Installation

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

Getting Started

Configure the API:

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

Send events:

# see `Hedgex.Capture` for more information
iex> Hedgex.capture(%{event: "foo_created", distinct_id: "user_12345"})
:ok

Issue API requests directly:

# provide creds dynamically
iex(1)> Hedgex.Api.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.