cekat-event-sdk 0.2.0 → 0.3.0
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 +4 -4
- data/README.md +4 -3
- data/lib/cekat_event_sdk/client.rb +4 -0
- data/lib/cekat_event_sdk/version.rb +1 -1
- data/lib/cekat_event_sdk.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f9238be53f82b0d930ef3504555edaac544bf5743094a78cbcea5d8c470f4a6
|
|
4
|
+
data.tar.gz: 6f7f015e3391ad9782cfd0067208a5eda7250b19b030be4e5d67ef5b309cd124
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 457d2f820006ad24fb3fd5420765dd4b16d96d3970051cddcb278268d70c240290ceeba17e8b9dfa08d7df36adf2e63e4457f9e97a153f0469a130d5cb0b0e95
|
|
7
|
+
data.tar.gz: afd34ab171c2eec29a7e312360dee784108feeac0617e9c63628ced136b83914f6e063afd046201c80ecebe9cfc08035c32796998534d5430822a9020e27ed81
|
data/README.md
CHANGED
|
@@ -20,11 +20,12 @@ CEKAT = CekatEventSdk::Client.new(access_token: ENV.fetch("CEKAT_ACCESS_TOKEN"))
|
|
|
20
20
|
CEKAT.user_registration(email: "person@example.com", contact_name: "Person")
|
|
21
21
|
CEKAT.user_login(phone_number: "+628123456789")
|
|
22
22
|
CEKAT.order_created(email: "person@example.com", properties: { order_id: "o-1" })
|
|
23
|
+
CEKAT.form_submitted(email: "person@example.com", properties: { form_id: "contact" })
|
|
23
24
|
CEKAT.order_paid(email: "person@example.com", properties: { order_id: "o-1" }, amount: 125_000, currency: "IDR")
|
|
24
25
|
ack = CEKAT.custom_event("wishlist_updated", email: "person@example.com")
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
Every event method also accepts a `CekatEventSdk::EventInput` or a Hash instead of keyword attributes. `order_paid` additionally requires a finite `amount:` (Integer, Float, BigDecimal, or Rational) and a nonblank `currency:`, sent as the `amount` and `currency` properties; do not also put those keys in `properties`.
|
|
28
|
+
`form_submitted` sends the common `form_submitted` event (`is_common: true`). Every event method also accepts a `CekatEventSdk::EventInput` or a Hash instead of keyword attributes. `order_paid` additionally requires a finite `amount:` (Integer, Float, BigDecimal, or Rational) and a nonblank `currency:`, sent as the `amount` and `currency` properties; do not also put those keys in `properties`.
|
|
28
29
|
|
|
29
30
|
An `Acknowledgement` means Cekat accepted the event for **asynchronous processing**. It does not confirm durable storage, identity resolution, delivery completion, or analytics availability.
|
|
30
31
|
|
|
@@ -131,7 +132,7 @@ Transport failures, timeouts, and HTTP 429, 500, 502, 503, and 504 are retried,
|
|
|
131
132
|
## Configuration
|
|
132
133
|
|
|
133
134
|
```ruby
|
|
134
|
-
CekatEventSdk::Client.new(access_token: token, base_url: "https://
|
|
135
|
+
CekatEventSdk::Client.new(access_token: token, base_url: "https://t.cekat.ai", timeout: 3, retry_count: 2)
|
|
135
136
|
```
|
|
136
137
|
|
|
137
138
|
`base_url` must be an absolute HTTP(S) origin without credentials, path, query, or fragment; the SDK always posts to `/api/events/ingest`. Requests send `User-Agent: cekat-event-sdk-ruby/<version>`.
|
|
@@ -144,7 +145,7 @@ The Net::HTTP transport opens a fresh connection per attempt, never follows redi
|
|
|
144
145
|
bundle install
|
|
145
146
|
bundle exec rake # core, Rack, and Rails specs plus RuboCop
|
|
146
147
|
RAILS_VERSION="~> 8.0.0" RACK_VERSION="~> 2.2" bundle update && bundle exec rake spec
|
|
147
|
-
./scripts/package --version 0.
|
|
148
|
+
./scripts/package --version 0.3.0 --output /absolute/empty-directory
|
|
148
149
|
```
|
|
149
150
|
|
|
150
151
|
`scripts/package` runs the specs, RuboCop, and `bundle-audit`, then builds the gem and a SHA-256 `manifest.json`. It never pushes, signs, or tags; releases to RubyGems run from the repository's `release-ruby.yml` workflow when a `ruby/vX.Y.Z` tag is pushed. `scripts/conformance` runs the shared conformance fixtures (see `conformance/README.md`); the three caller-cancellation cases are reported as `not_applicable` for Ruby.
|
|
@@ -48,6 +48,10 @@ module CekatEventSdk
|
|
|
48
48
|
track("order_created", true, event_from(event, attributes))
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def form_submitted(event = nil, **attributes)
|
|
52
|
+
track("form_submitted", true, event_from(event, attributes))
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
# The required finite amount and nonblank currency are sent as the "amount" and "currency"
|
|
52
56
|
# properties; the event's properties must not already contain either key.
|
|
53
57
|
def order_paid(event = nil, amount:, currency:, **attributes)
|
data/lib/cekat_event_sdk.rb
CHANGED
|
@@ -4,7 +4,7 @@ require_relative "cekat_event_sdk/version"
|
|
|
4
4
|
|
|
5
5
|
# Cekat event SDK: submit identity-bearing events and correlate them with the browser visitor.
|
|
6
6
|
module CekatEventSdk
|
|
7
|
-
DEFAULT_BASE_URL = "https://
|
|
7
|
+
DEFAULT_BASE_URL = "https://t.cekat.ai"
|
|
8
8
|
INGEST_PATH = "/api/events/ingest"
|
|
9
9
|
VISITOR_HEADER = "X-Cekat-Visitor-ID"
|
|
10
10
|
VISITOR_COOKIE = "_cekat_visitor_id"
|