Git Product home page Git Product logo

tmchow / rudder-sdk-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rudderlabs/rudder-sdk-ruby

0.0 0.0 0.0 488 KB

Ruby SDK for RudderStack - Open-source, warehouse-first Customer Data Pipeline and Segment-alternative. Collects and routes clickstream data and builds your customer data lake on your data warehouse.

Home Page: https://rudderstack.com/

License: MIT License

Ruby 100.00%

rudder-sdk-ruby's Introduction

The Customer Data Platform for Developers

Website · Documentation · Community Slack


RudderStack Ruby SDK

The RudderStack Ruby SDK lets you send customer event data from your Ruby applications to your specified destinations.

SDK setup requirements

Installation

To install the RudderStack Ruby SDK, add this line to your application's Gem file:

gem 'rudder-sdk-ruby'

You can also install the SDK into your environment gems by running the following command:

gem install 'rudder-sdk-ruby'

Using the SDK

To use the Ruby SDK, create a client instance as shown:

require 'rudder-sdk-ruby'

analytics = Rudder::Analytics.new(
  :write_key => 'WRITE_KEY',
  :data_plane_url => 'DATA_PLANE_URL',
  :gzip => true
)
Make sure to replace WRITE_KEY and DATA_PLANE_URL in the above snippet with the actual values from your RudderStack dashboard.

You can then use this client to send the events. A sample track call sent using the client is shown below:

analytics.track(
  :user_id => '1hKOmRA4GRlm',
  :event => 'Item Sold',
  :properties => { :revenue => 9.95, :shipping => 'Free' }
)

Gzipping requests

The Gzip feature is enabled by default in the Ruby SDK. However, you can disable this feature by setting the gzip parameter to false while initializing the SDK:

analytics = Rudder::Analytics.new(
  :write_key => 'WRITE_KEY', # required
  :data_plane_url => 'DATA_PLANE_URL',
  :gzip => false, // Set to true to enable Gzip compression
  :on_error => proc { |error_code, error_body, exception, response|
    # defaults to an empty proc
  }
)
Note: Gzip requires rudder-server version 1.4 or later. Otherwise, your events might fail.

Sending events

Refer to the RudderStack Ruby SDK documentation for more information on the supported event types.

Test queue

Enable the stub option while initializing the SDK to stub all the requests, making it easier for you to test with this library.

License

The RudderStack Ruby SDK is released under the MIT license.

rudder-sdk-ruby's People

Contributors

rohitpaulk avatar travisjeffery avatar f2prateek avatar calvinfo avatar nd4p90x avatar pooyaj avatar sayan-rudder avatar benjaminhoffman avatar dominicbarnes avatar sonianand11 avatar ameypv-rudder avatar 1abhishekpandey avatar pallabmaiti avatar hadees avatar alloy avatar amillet89 avatar kylev avatar sumanthpuram avatar prabrisha-rudder avatar annc128 avatar yields avatar arronmabrey avatar raghuvarmabh avatar ryanwjackson avatar zeke avatar ishachopra0401 avatar williamgrosset avatar tyler-goodwin avatar nijikon avatar teresanesteby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.