altertable 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c5cf2ceb0732f00a0017795d33e2c28fe1b3c131bd443d3c00247eeddc88c25
4
- data.tar.gz: 8941f4802ae2ee21517353ce0628420a70ffa3a823855d32d3d4daab62315b32
3
+ metadata.gz: 6578d35fc3a2278e59800c3e1856da5f5a569b8051d912d4dff7f0485fde74e9
4
+ data.tar.gz: f29994d0c964d70e1f45b000e1fc19ef5ae8b7ce1464d46f3f423374e4d17c15
5
5
  SHA512:
6
- metadata.gz: ff9de77df94949d60e633985af119074276e334352ccce1fb510f2bb68f2acface25aaaaf256a3585118cccc3e79898386d226e3df036937f03bf0e5986ace7c
7
- data.tar.gz: 0f7eafb061c8d266952cb6549c124e53fcc1b9c53e2c961fc8298eeefd91bd2b716b9cb681afcc93bf5632d20cac5e6ffbf32c93faad8849e618afd02b69512d
6
+ metadata.gz: '029043ea4734d6ef374f7a426fc48c0b2a387c40d2cd6c5db332e0fef769da063a9ef884ecef6b6538a92d62830b92ddf6b9b76e3753552014332977cc56cc5d'
7
+ data.tar.gz: 9d517e40f86b34ad5985df17c4ed1511d0c0e0bc8231e24f2fae2a3bf698fc34838ac4d7291a07f9ae1c18a4e520c481c5c9c84c6d605e982f226c6f7147fca2
@@ -3,9 +3,7 @@ name: CI
3
3
  on:
4
4
  push:
5
5
  branches: [main]
6
- pull_request:
7
- branches: [main]
8
-
6
+ pull_request: {}
9
7
  jobs:
10
8
  lint:
11
9
  runs-on: ubuntu-latest
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.1.1"
2
+ ".": "1.1.2"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.2](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v1.1.1...altertable/v1.1.2) (2026-03-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **readme:** correct package name ([#33](https://github.com/altertable-ai/altertable-ruby/issues/33)) ([5838578](https://github.com/altertable-ai/altertable-ruby/commit/58385785e8849cda3627bdd04e563eadab933ba3))
9
+ * **transport:** remove the hard dep on `faraday-retry` ([#42](https://github.com/altertable-ai/altertable-ruby/issues/42)) ([f758d02](https://github.com/altertable-ai/altertable-ruby/commit/f758d0254d86de2ea3d6105a429d885c6a8aadbf))
10
+
3
11
  ## [1.1.1](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v1.1.0...altertable/v1.1.1) (2026-03-09)
4
12
 
5
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- altertable (1.1.1)
4
+ altertable (1.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -25,8 +25,6 @@ GEM
25
25
  logger
26
26
  faraday-net_http (3.4.2)
27
27
  net-http (~> 0.5)
28
- faraday-retry (2.4.0)
29
- faraday (~> 2.0)
30
28
  http-2 (1.1.3)
31
29
  httpx (1.7.3)
32
30
  http-2 (>= 1.1.3)
@@ -144,8 +142,6 @@ DEPENDENCIES
144
142
  altertable!
145
143
  base64
146
144
  faraday (~> 2.0)
147
- faraday-net_http
148
- faraday-retry
149
145
  httpx
150
146
  rake (~> 13.0)
151
147
  rbs
data/README.md CHANGED
@@ -1,55 +1,98 @@
1
1
  # Altertable Ruby SDK
2
2
 
3
+ [![Build Status](https://github.com/altertable-ai/altertable-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/altertable-ai/altertable-ruby/actions)
4
+ [![Gem Version](https://badge.fury.io/rb/altertable.svg)](https://rubygems.org/gems/altertable)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+
3
7
  Official Ruby SDK for Altertable Product Analytics.
4
8
 
5
- ## Installation
9
+ ## Install
6
10
 
7
- Add this line to your application's Gemfile:
11
+ Install the gem with a single command:
8
12
 
9
- ```ruby
10
- gem 'altertable-ruby'
13
+ ```bash
14
+ gem install altertable
11
15
  ```
12
16
 
13
- And then execute:
14
-
15
- $ bundle install
16
-
17
- ## Usage
17
+ ## Quick Start
18
18
 
19
- ### Initialization
19
+ Initialize the client and track your first event. Call `track()` to record an action a user performed.
20
20
 
21
21
  ```ruby
22
22
  require 'altertable'
23
23
 
24
- Altertable.init('your_api_key', {
25
- environment: 'production'
24
+ # Initialize the Altertable client
25
+ Altertable.init('pk_live_abc123', environment: 'production')
26
+
27
+ # Track an event
28
+ Altertable.track('button_clicked', 'user_123', properties: {
29
+ button_id: 'signup_btn',
30
+ page: 'home'
26
31
  })
27
32
  ```
28
33
 
34
+ ## API Reference
35
+
36
+ ### Initialization
37
+
38
+ Initialize the global Altertable client instance.
39
+
40
+ `Altertable.init(api_key, options = {})`
41
+
42
+ ```ruby
43
+ Altertable.init('pk_live_abc123', environment: 'production', debug: true)
44
+ ```
45
+
29
46
  ### Tracking Events
30
47
 
48
+ Record an action performed by a user.
49
+
50
+ `Altertable.track(event, distinct_id, **options)`
51
+
31
52
  ```ruby
32
- Altertable.track('button_clicked', 'user_123', properties: {
33
- button_id: 'signup_btn',
34
- page: 'home'
35
- }, timestamp: Time.now.utc.iso8601)
53
+ Altertable.track('item_purchased', 'user_123', properties: {
54
+ item_id: 'item_999',
55
+ price: 19.99
56
+ })
36
57
  ```
37
58
 
38
59
  ### Identifying Users
39
60
 
61
+ Link a user ID to their traits (like email or name).
62
+
63
+ `Altertable.identify(user_id, **options)`
64
+
40
65
  ```ruby
41
66
  Altertable.identify('user_123', traits: {
42
67
  email: 'user@example.com',
43
68
  name: 'John Doe'
44
- }, anonymous_id: 'previous_anon_id')
69
+ })
45
70
  ```
46
71
 
47
72
  ### Alias
48
73
 
74
+ Merge a previous anonymous ID with a newly identified user ID.
75
+
76
+ `Altertable.alias(distinct_id, new_user_id, **options)`
77
+
49
78
  ```ruby
50
- Altertable.alias('previous_anonymous_id', 'new_user_id')
79
+ Altertable.alias('anon_session_456', 'user_123')
51
80
  ```
52
81
 
82
+ ## Configuration
83
+
84
+ You can configure the client by passing options during initialization.
85
+
86
+ | Option | Type | Default | Description |
87
+ |---|---|---|---|
88
+ | `environment` | String | `"production"` | Environment name (e.g., `production`, `development`). |
89
+ | `base_url` | String | `"https://api.altertable.ai"` | Base URL for API requests. |
90
+ | `request_timeout` | Integer | `5` | Request timeout in seconds. |
91
+ | `release` | String | `nil` | Application release version (e.g., commit hash). |
92
+ | `debug` | Boolean | `false` | Enable debug logging. |
93
+ | `on_error` | Proc | `nil` | Callback for handling errors. |
94
+ | `adapter` | Symbol | auto-detect | HTTP adapter to use (`:faraday`, `:httpx`, `:net_http`). |
95
+
53
96
  ## License
54
97
 
55
98
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/altertable.gemspec CHANGED
@@ -37,7 +37,5 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  # Optional adapter support (development only)
39
39
  spec.add_development_dependency "faraday", "~> 2.0"
40
- spec.add_development_dependency "faraday-retry"
41
- spec.add_development_dependency "faraday-net_http"
42
40
  spec.add_development_dependency "httpx"
43
41
  end
@@ -18,13 +18,10 @@ module Altertable
18
18
  def initialize(base_url:, timeout:, headers: {})
19
19
  super
20
20
  require "faraday"
21
- require "faraday/retry"
22
- require "faraday/net_http"
23
21
 
24
22
  @conn = Faraday.new(url: @base_url) do |f|
25
23
  @headers.each { |k, v| f.headers[k] = v }
26
24
  f.options.timeout = @timeout
27
- f.request :retry, max: 3, interval: 0.05, backoff_factor: 2
28
25
  f.adapter Faraday.default_adapter
29
26
  end
30
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Altertable
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: altertable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Altertable
@@ -149,34 +149,6 @@ dependencies:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
151
  version: '2.0'
152
- - !ruby/object:Gem::Dependency
153
- name: faraday-retry
154
- requirement: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- version: '0'
159
- type: :development
160
- prerelease: false
161
- version_requirements: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: '0'
166
- - !ruby/object:Gem::Dependency
167
- name: faraday-net_http
168
- requirement: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: '0'
173
- type: :development
174
- prerelease: false
175
- version_requirements: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: '0'
180
152
  - !ruby/object:Gem::Dependency
181
153
  name: httpx
182
154
  requirement: !ruby/object:Gem::Requirement