bentonow_client v1.0.1
bentonow_client
A crystal lang wrapper for the Bentonow API.
Installation
-
Add the dependency to your
shard.yml
:dependencies: bentonow_client: github: hostari/bentonow_client
-
Run
shards install
Usage
Set the following api keys in .env
: publishable_key
, secret_key
, site_uuid
.
require "bentonow_client"
To build a new Bentonow client:
publishable_key = ENV["BENTO_PUBLISHABLE_KEY"]
secret_key = ENV["BENTO_SECRET_KEY"]
client = Bentonow::Client.new(publishable_key, secret_key)
Endpoints
Most useful available Bentonow API resources are implemented.
- Creating an Event - for single or batch processing of events such as adding users and other user information, adding tags to already exisiting users, or adding fields to existing users.
body = {
events: [
{
type: "$completed_onboarding",
email: "test@test.com"
},
{
type: "$completed_onboarding",
email: "test@test.com",
fields: {
first_name: "Jesse",
last_name: "Pinkman"
}
},
{
email: "test@test.com",
type: "$purchase",
fields: {
first_name: "Jesse"
},
details: {
unique: {
key: "test123"
},
value: {
currency: "USD",
amount: 8000
},
cart: {
items: [
{
product_sku: "SKU123",
product_name: "Test",
quantity: 100
}
],
abandoned_checkout_url: "https://test.com"
}
}
}
]
}.to_json
site_uuid = ENV["BENTO_SITE_UUID"]
event = Bentonow::Event.create_event(publishable_key, secret_key, site_uuid, body)
Contributing
- Fork it (https://github.com/your-github-user/bentonow_client/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Pauline De Polonia - creator
- Xavi Ablaza - maintainer
Repository
bentonow_client
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- 6 months ago
- June 20, 2022
License
MIT License
Links
Synced at
Sat, 21 Dec 2024 08:22:43 GMT
Languages