posthog v0.1.0 Posthog

This module provides an Elixir HTTP client for Posthog.

Example config:

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.

Link to this section Summary

Functions

See Posthog.Client.batch/1.

Sends a capture event. distinct_id is the only required parameter.

Link to this section Functions

Specs

batch([tuple()]) :: result()

See Posthog.Client.batch/1.

Link to this function

capture(event, params, timestamp \\ nil)

Specs

capture(atom() | String.t(), keyword() | map(), timestamp()) :: result()

Sends a capture event. distinct_id is the only required parameter.

Examples

iex> Posthog.capture("login", distinct_id: user.id)
:ok
iex> Posthog.capture("login", [distinct_id: user.id], DateTime.utc_now())
:ok