Packages
posthog
0.1.0
2.16.2
2.16.1
2.16.0
2.15.1
2.15.0
2.14.2
2.14.1
2.14.0
2.13.0
2.12.1
2.12.0
2.11.1
2.11.0
2.10.3
2.10.2
2.10.1
2.10.0
2.9.2
2.9.1
2.9.0
2.8.4
2.8.3
2.8.2
2.8.1
2.8.0
2.7.1
2.7.0
2.6.1
2.6.0
2.5.0
2.4.0
2.3.0
2.2.0
2.1.0
2.0.0
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.0
0.2.0
0.1.0
Official PostHog Elixir SDK
Current section
Files
Jump to
Current section
Files
README.md
# 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`:
```elixir
def deps do
[
{:posthog, "~> 0.1"}
]
end
```
## Configuration
```elixir
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:
```elixir
Posthog.capture("login", distinct_id: user.id)
```
Capturing multiple events:
```elixir
Posthog.batch([{"login", [distinct_id: user.id], nil}])
```