Skip to content

Commit b077aba

Browse files
committed
Expose capture/2
The examples and docs all use it, but the `defdelegate` is hiding the 2 arity version. This makes it available for calling. Before: ``` iex(2)> Posthog.capture("page_view", "user_123") ** (UndefinedFunctionError) function Posthog.capture/2 is undefined or private. Did you mean: * capture/3 * capture/4 (posthog 1.0.3) Posthog.capture("page_view", "user_123") iex:2: (file) ``` After: ``` iex(1)> Posthog.capture("page_view", "user_123") {:ok, %{ status: 200, body: %{"status" => "Ok"}, headers: [ {"Date", "Tue, 01 Jul 2025 05:45:56 GMT"}, {"Content-Type", "application/json"}, {"Content-Length", "15"}, {"Connection", "keep-alive"}, {"vary", "origin, access-control-request-method, access-control-request-headers"}, {"access-control-allow-credentials", "true"}, {"x-envoy-upstream-service-time", "64"}, {"server", "envoy"}, {"Strict-Transport-Security", "max-age=31536000; includeSubDomains"} ] }} ```
1 parent f66bde7 commit b077aba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/posthog.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ defmodule Posthog do
144144

145145
@spec capture(Client.event(), Client.distinct_id(), Client.properties(), Client.opts()) ::
146146
Client.result()
147-
defdelegate capture(event, distinct_id, properties, opts \\ []), to: Client
147+
defdelegate capture(event, distinct_id, properties \\ %{}, opts \\ []), to: Client
148148

149149
@doc """
150150
Sends multiple events to PostHog in a single request.

0 commit comments

Comments
 (0)