A crystal lang wrapper for the Bentonow API.
-
Add the dependency to your
shard.yml
:dependencies: bentonow_client: github: hostari/bentonow_client
-
Run
shards install
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)
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: "[email protected]"
},
{
type: "$completed_onboarding",
email: "[email protected]",
fields: {
first_name: "Jesse",
last_name: "Pinkman"
}
},
{
email: "[email protected]",
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)
- 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
- Pauline De Polonia - creator
- Xavi Ablaza - maintainer