Code Monkey home page Code Monkey logo

brein-api-library-ruby's Introduction

Breinify API Java Library

Breinify's DigitalDNA API puts dynamic behavior-based, people-driven data right at your fingertips.

[![version][gem-version]][gem-url]

[![License][license-image]][license-url]

Step By Step Introduction

What is Breinify's DigitialDNA

Breinify's DigitalDNA API puts dynamic behavior-based, people-driven data right at your fingertips. We believe that in many situations, a critical component of a great user experience is personalization. With all the data available on the web it should be easy to provide a unique experience to every visitor, and yet, sometimes you may find yourself wondering why it is so difficult.

Thanks to Breinify's DigitalDNA you are now able to adapt your online presence to your visitors needs and provide a unique experience. Let's walk step-by-step through a simple example.

Quick start

Step 1: Installation

Add this line to your application's Gemfile:

gem 'Breinify'

And then execute:

$ bundle

Or install it yourself as:

$ gem install Breinify

Step 2: Configure the library

In order to use the library you need a valid API-key, which you can get for free at https://www.breinify.com. In this example, we assume you have the following api-key:

772A-47D7-93A3-4EA9-9D73-85B9-479B-16C6

# configure 
Breinify.setConfig({'apiKey' => '772A-47D7-93A3-4EA9-9D73-85B9-479B-16C6',
                    'activityEndpoint' => '/activity',
                    'lookupEndpoint' => '/lookup',
                    'secret' => 'lmcoj4k2ttzz66qamhg!=',
                    'timeout' => 1000,
                    'url' => 'https://api.breinify.com'})
                    

The Breinify class is now configured with a valid configuration object.

Step 3: Start using the library

Placing activity triggers

The engine powering the DigitalDNA API provides two endpoints. The first endpoint is used to inform the engine about the activities performed by visitors of your site. The activities are used to understand the user's current interest and infer the intent. It becomes more and more accurate across different users and verticals as more activities are collected. It should be noted, that any personal information is not stored within the engine, thus each individual's privacy is well protected. The engine understands several different activities performed by a user, e.g., landing, login, search, item selection, or logout.

The engine is informed of an activity by executing Breinify.activity(...).

# invoke the activity call containing the mandatory fields
Breinify.activity({'user' => 
		{'email' => '[email protected]',
	     'activity' => {
             'type' => 'checkout',
             'category' => 'food'
        }})

That's it! The call will be invoked.

The following snippets shows a different approach and the fields that are currently supported:

  userData = Hash.new
  userData['email'] = '[email protected]'
  userData['lastName'] = 'Fred'
  userData['firstName'] = 'Firestone'
  userData['sessionId'] = 'aa8!scdfsf8988'

  additionalData = Hash.new
  additionalData['referrer'] = 'https://sampleurl.com/track'
  additionalData['url'] = 'https://sampleurl.com/'

  userData['additional'] = additionalData

  activityData = Hash.new
  activityData['description'] = 'this is the description'
  activityData['type'] = 'checkout'

  requestData = Hash.new
  requestData['user'] = userData
  requestData['activity'] = activityData
  requestData['ipAddress'] = '10.111.222.333'

  Breinify.activity(requestData)

That's it! The call will be invoked.

Further information

License

The gem is available as open source under the terms of the MIT License.

Further links

To understand all the capabilities of Breinify's DigitalDNA API, take a look at:

brein-api-library-ruby's People

Contributors

jorellis13 avatar pmeisen avatar marcorecchioni avatar

Watchers

 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.