Skip to content

swift-eco/posthog

This branch is 39 commits behind PostHog/posthog-elixir:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

May 4, 2024
2babf65 · May 4, 2024

History

5 Commits
May 3, 2024
Jun 6, 2020
Jun 6, 2020
Jun 6, 2020
Jun 6, 2020
May 4, 2024
May 4, 2024
Jun 6, 2020

Repository files navigation

Posthog

This library provides an HTTP client for Posthog.

Installation

The package can be installed by adding posthog to your list of dependencies in mix.exs:

def deps do
  [
    {:posthog, "~> 0.2"}
  ]
end

Configuration

config :posthog,
  api_url: "http://posthog.example.com",
  api_key: "..."

Optionally, you can pass in a :json_library key. The default JSON parser is Jason.

Usage

Capturing events:

Posthog.capture("login", distinct_id: user.id)

Specifying additional headers:

Posthog.capture("login", [distinct_id: user.id], [headers: [{"x-forwarded-for", "127.0.0.1"}]])

Capturing multiple events:

Posthog.batch([{"login", [distinct_id: user.id], nil}])

About

Elixir client for Posthog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%