Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Breinify API Java Library

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

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 In this example, we assume you have the following api-key:


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

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 
Breinify.activity({'user' => {'firstName' => 'Fred',
                                'email' => '',
                                'lastName' => 'Firestone',
                                'sessionId' => 'r3V2kDAvFFL_-RBhuc_-Dg'},
                     'activity' => {
                         'description' => 'this is the description',
                         'type' => 'checkout',
                         'category' => 'food',
                         'tagsMap' => {'string' => 'string',
                                    'int' => 5,
                                    'double' => 9.1,
                                    'array' => %w(a b c),
                                    'null' => nil}

That's it! The call will be invoked.

The following snippets shows a different approach:

  userData =
  userData['email'] = ''
  userData['lastName'] = 'Fred'
  userData['firstName'] = 'Firestone'
  userData['sessionId'] = 'aa8!scdfsf8988'

  additionalData =
  additionalData['referrer'] = ''
  additionalData['url'] = ''

  userData['additional'] = additionalData

  activityData =
  activityData['description'] = 'this is the description'
  activityData['type'] = 'checkout'

  requestData =
  requestData['user'] = userData
  requestData['activity'] = activityData
  requestData['ipAddress'] = ''


That's it! The call will be invoked.

Further information


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:


Breinify's Ruby (also for Ruby On Rails) API Library




No releases published


No packages published