Skip to content

Commit 1bdd5ad

Browse files
committed
Release v1.0.3
1 parent 31ad7af commit 1bdd5ad

4 files changed

Lines changed: 26 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.0.2] - 2025-12-04
8+
## [1.0.3] - 2025-12-04
99

10-
Updated examples in the README
10+
Update documentation
1111

README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ client.track('Button Clicked', {
4343
plan: 'pro'
4444
}, user_id: 'user_123')
4545

46-
# Associate a user with a group
46+
# Associate user with a group and set group traits
47+
client.group('org_456', {
48+
name: 'Acme Inc',
49+
plan: 'enterprise'
50+
}, user_id: 'user_123')
51+
52+
# Or just link the user to a group (if traits are already set)
4753
client.group('org_456', user_id: 'user_123')
4854

4955
# Shutdown gracefully
@@ -74,19 +80,20 @@ Klime::Client.new(
7480
Track a user event. A `user_id` is required for events to be useful in Klime.
7581

7682
```ruby
77-
# Basic usage
7883
client.track('Button Clicked', {
7984
button_name: 'Sign up',
8085
plan: 'pro'
8186
}, user_id: 'user_123')
8287

83-
# With group context and IP
88+
# With IP address (for geolocation)
8489
client.track('Button Clicked', {
8590
button_name: 'Sign up',
8691
plan: 'pro'
87-
}, user_id: 'user_123', group_id: 'org_456', ip: '192.168.1.1')
92+
}, user_id: 'user_123', ip: '192.168.1.1')
8893
```
8994

95+
> **Advanced**: The `group_id` parameter is available for multi-tenant scenarios where a user belongs to multiple organizations and you need to specify which organization context the event occurred in.
96+
9097
#### `identify(user_id, traits = nil, ip: nil)`
9198

9299
Identify a user with traits.
@@ -100,22 +107,23 @@ client.identify('user_123', {
100107

101108
#### `group(group_id, traits = nil, user_id: nil, ip: nil)`
102109

103-
Register a group or associate a user with a group.
104-
105-
**Without `user_id`**: Register or update group metadata. Use this when you want to set or update properties on a group (e.g., company name, plan, industry).
110+
Associate a user with a group and/or set group traits.
106111

107112
```ruby
113+
# Associate user with a group and set group traits (most common)
108114
client.group('org_456', {
109115
name: 'Acme Inc',
110-
plan: 'enterprise',
111-
industry: 'Technology'
112-
})
113-
```
114-
115-
**With `user_id`**: Associate a user with a group. Use this to link users to their organization. Keep it simple—no traits needed.
116+
plan: 'enterprise'
117+
}, user_id: 'user_123')
116118

117-
```ruby
119+
# Just link a user to a group (traits already set or not needed)
118120
client.group('org_456', user_id: 'user_123')
121+
122+
# Just update group traits (e.g., from a webhook or background job)
123+
client.group('org_456', {
124+
plan: 'enterprise',
125+
employee_count: 50
126+
})
119127
```
120128

121129
#### `flush`

klime.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |spec|
44
spec.name = "klime"
5-
spec.version = "1.0.2"
5+
spec.version = "1.0.3"
66
spec.authors = ["Klime"]
77
spec.email = ["[email protected]"]
88

lib/klime/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

33
module Klime
4-
VERSION = "1.0.2"
4+
VERSION = "1.0.3"
55
end
66

0 commit comments

Comments
 (0)