Skip to content

Commit 196c732

Browse files
committed
Library known as LogHog moves in 😳
1 parent 9fba9c0 commit 196c732

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2893
-2673
lines changed

‎.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ posthog-*.tar
2828

2929
# Ignore .DS_Store
3030
.DS_Store
31+
32+
# Local Config
33+
config/dev.exs
34+
config/integration.exs

‎.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.18.3
1+
elixir 1.18.3-otp-27
22
erlang 27.3.3

‎CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
- Elixir v1.14+ is now a requirement
2626
- Feature Flags now return a key called `payload` rather than `value` to better align with the other SDKs
27-
- PostHog now requires you to initialize `Posthog.Application` alongside your supervisor tree. This is required because of our `Cachex` system to properly track your FF usage.
27+
- PostHog now requires you to initialize `PostHog.Application` alongside your supervisor tree. This is required because of our `Cachex` system to properly track your FF usage.
2828
- We'll also include local evaluation in the near term, which will also require a GenServer, therefore, requiring us to use a Supervisor.
2929
- Added `enabled_capture` configuration option to disable PostHog tracking in development/test environments
30-
- `Posthog.capture` now requires `distinct_id` as a required second argument
30+
- `PostHog.capture` now requires `distinct_id` as a required second argument
3131

3232
## 0.4.4 - 2025-04-14
3333

‎MIGRATION.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This is a migration guide for all major version bumps
44

5+
## v2.0
6+
7+
TODO: New library
8+
59
## v0-v1
610

711
When we stabilized our library, we decided to pull some breaking changes, here are they and how you can migrate:
@@ -17,12 +21,12 @@ The library previously supported Elixir v1.12+. You'll need to migrate to Elixir
1721

1822
PostHog is consistently upgrading our internal data representation so that's better for customers each and every time. We've recently launched a new version of our `/decide` endpoint called `v4`. This endpoint is slightly different, which caused a small change in behavior for our flags.
1923

20-
`Posthog.FeatureFlag` previously included a key `value` that to represent the internal structure of a flag. It was renamed to `payload` to:
24+
`PostHog.FeatureFlag` previously included a key `value` that to represent the internal structure of a flag. It was renamed to `payload` to:
2125

2226
1. better represent the fact that it can be both an object and a boolean
2327
2. align it more closely with our other SDKs
2428

25-
### Posthog.Application
29+
### PostHog.Application
2630

2731
This library now depends on `Cachex`, and includes a supervision tree. There are 2 options:
2832

@@ -39,7 +43,7 @@ def application do
3943
end
4044
```
4145

42-
2. Or, if you're already using an Application, you can add add `Posthog.Application` to your own supervision tree:
46+
2. Or, if you're already using an Application, you can add add `PostHog.Application` to your own supervision tree:
4347

4448
```elixir
4549
# lib/my_app/application.ex
@@ -49,7 +53,7 @@ defmodule MyApp.Application do
4953
def start(_type, _args) do
5054
children = [
5155
# Your other children...
52-
{Posthog.Application, []}
56+
{PostHog.Application, []}
5357
]
5458

5559
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
@@ -58,32 +62,32 @@ defmodule MyApp.Application do
5862
end
5963
```
6064

61-
### `Posthog.capture` new signature
65+
### `PostHog.capture` new signature
6266

63-
The signature to `Posthog.capture` has changed. `distinct_id` is now a required argument.
67+
The signature to `PostHog.capture` has changed. `distinct_id` is now a required argument.
6468

6569
Here are some examples on how the method is now used:
6670

6771
```elixir
6872
# Basic event with `event` and `distinct_id`, both required
69-
Posthog.capture("page_view", "user_123")
73+
PostHog.capture("page_view", "user_123")
7074

7175
# Event with properties
72-
Posthog.capture("purchase", "user_123", %{
76+
PostHog.capture("purchase", "user_123", %{
7377
product_id: "prod_123",
7478
price: 99.99,
7579
currency: "USD"
7680
})
7781

7882
# Event with custom timestamp
79-
Posthog.capture("signup_completed", "user_123", %{}, timestamp: DateTime.utc_now())
83+
PostHog.capture("signup_completed", "user_123", %{}, timestamp: DateTime.utc_now())
8084

8185
# Event with custom UUID
8286
uuid = "..."
83-
Posthog.capture("signup_completed", "user_123", %{}, uuid: uuid)
87+
PostHog.capture("signup_completed", "user_123", %{}, uuid: uuid)
8488

8589
# Event with custom headers
86-
Posthog.capture(
90+
PostHog.capture(
8791
"login",
8892
"user_123",
8993
%{},

0 commit comments

Comments
 (0)