Project

evntaly

0.0
The project is in a healthy, maintained state
Evntaly official library for your ruby projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
~> 13.0
~> 3.10

Runtime

~> 2.5
~> 0.1.0
 Project Readme

Evntaly Cover

Evntaly

An advanced event tracking and analytics platform designed to help developers capture, analyze, and react to user interactions efficiently.

Gem Version license

evntaly-ruby

EvntalySDK is a ruby gem for interacting with the Evntaly event tracking platform. It provides methods to initialize tracking, log events, identify users, and check API usage limits.

Features

  • Initialize the SDK with a developer secret and project token.
  • Track events with metadata and tags.
  • Identify users for personalization and analytics.
  • Enable or disable tracking globally.

Installation

To install the SDK using bundler:

 gem 'evntaly', '~> 1.0'

and then run:

bundle install

or install directly using:

gem install evntaly

Usage

Initialization

Initialize the SDK with your developer secret and project token:

sdk = Evntaly::SDK.new(
    developer_secret: 'YOUR_DEVELOPER_SECRET',
    project_token: 'YOUR_PROJECT_TOKEN'
)

Tracking Events

To track an event:

 event = Evntaly::Event.new(
  title: 'User Signed Up',
  description: 'A new user signed up to the platform.',
  message: 'Welcome email sent to the user.',
  data: { plan: 'pro', referrer: 'campaign_xyz' },
  tags: ['signup', 'email', 'marketing'],
  notify: true,
  icon: "💰",
  apply_rule_only: false,
  user: { id: '12345' },
  type: 'user_event',
  session_id: 'session_abc',
  feature: 'onboarding',
  topic: 'user_activity'
)

begin
  sdk.track(event)
rescue => e
  # error handling logic
end

Identifying Users

To identify a user:

user = Evntaly::User.new(
  id: 'u123',
  email: 'user@example.com',
  full_name: 'John Doe',
  organization: 'Example Org',
  data: { role: 'admin' }
)

begin
  sdk.identify_user(user)
rescue => e
  # error handling logic
end

Enabling/Disabling Tracking

Control event tracking globally:

 Evntaly::SDK.disable_tracking  # Disables tracking
 Evntaly::SDK.enable_tracking   # Enables tracking

And to check if tracking is enabled, do:

 Evntaly::SDK.tracking_enabled?

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

To release a new version, update the version number in version.rb, and then run bundle exec rake gh-release, which will create a git tag for the version.

License

This project is licensed under the MIT License.


Note: Replace "YOUR_DEVELOPER_SECRET" and "YOUR_PROJECT_TOKEN" with actual credentials.