Skip to content

Commit

Permalink
change config name from DefaultProperties to DefaultEventProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
jvitoroc committed Aug 10, 2024
1 parent f1fc326 commit 7aa3fd9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ type Config struct {
// `os.Stderr`.
Logger Logger

// Properties that will be included
// in every event sent by the client. This is useful for adding common metadata
// like service name or app version across all events.
DefaultProperties Properties
// Properties that will be included in every event sent by the client.
// This is useful for adding common metadata like service name or app version
// across all events.
DefaultEventProperties Properties

// The callback object that will be used by the client to notify the
// application when messages sends to the backend API succeeded or failed.
Expand Down
2 changes: 1 addition & 1 deletion posthog.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (c *client) Enqueue(msg Message) (err error) {
}
m.Properties["$active_feature_flags"] = featureKeys
}
m.Properties.Merge(c.DefaultProperties)
m.Properties.Merge(c.DefaultEventProperties)
c.setLastCapturedEvent(m)
msg = m

Expand Down
14 changes: 7 additions & 7 deletions posthog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,13 @@ func TestCaptureWithDefaultProperties(t *testing.T) {
defer server.Close()

client, _ := NewWithConfig("Csyjlnlun3OzyNJAafdlv", Config{
Endpoint: server.URL,
Verbose: true,
DefaultProperties: NewProperties().Set("service", "api"),
Logger: t,
BatchSize: 1,
now: mockTime,
uid: mockId,
Endpoint: server.URL,
Verbose: true,
DefaultEventProperties: NewProperties().Set("service", "api"),
Logger: t,
BatchSize: 1,
now: mockTime,
uid: mockId,
})
defer client.Close()

Expand Down

0 comments on commit 7aa3fd9

Please sign in to comment.