RGigya

RGigya is an sdk wrapper around the Gigya Rest Api.

Install

gem install rgigya

Getting started

Please read the documentation at gigya for best practices. developers.gigya.com/037_API_reference. You may need to create a developers account to access the documentation.

Get your api key and secret.

You will need to setup your own dev site on the gigya platform for testing.

Without Rails (Standalone)

require 'RGigya'

RGigya.config({
  :api_key => "<add api key here>",
  :api_secret => "<add api secret here>",
  :use_ssl => false,
  :domain => "us1"
})

RGigya.socialize_notifyLogin({:siteUID => '1'})

With Rails

Edit your config/environments/development.rb file and add the following constants

RGigya.config({
  :api_key => "<add api key here>",
  :api_secret => "<add api secret here>",
  :use_ssl => false,
  :domain => "us1"
})

Then add your api calls in your controllers, models, libraries, etc.

RGigya.socialize_notifyLogin({:siteUID => '1'})

Examples

socialize.notifyLogin

developers.gigya.com/037_API_reference/010_Socialize/socialize.notifyLogin

userInfo = {
  'nickname' => 'Gigems', 
  'email' => 'ralph@cloudspace.com',
  'firstName' => 'Ralph', 
  'lastName' => 'Masterson'
}

RGigya.socialize_notifyLogin({:siteUID => '1', :userInfo => userInfo.to_json} )

gm.notifyAction

developers.gigya.com/037_API_reference/040_GM/gm.notifyAction

RGigya.gm_notifyAction(:uid => '1',:action => 'comment_upvote')

comments.flagComment

developers.gigya.com/037_API_reference/030_Comments/comments.flagComment

gigya_params = {
  :commentID => params[:commentID],
  :categoryID => params[:categoryID],
  :streamID => params[:streamID]
}

RGigya.comments_flagComment(gigya_params)

Rspec Tests

We have included rspec unit tests.

Configuration

Edit spec/spec_helper.rb

Replace <add api key here> with your api key
Replace <add api secret here> with your api secret

Running tests

cd <root of the project>
rspec

Rails dummy site

We have included a rails dummy site to give you an idea of how to integrate the gem within rails. It just peforms a simple login.

Configuration

Running the rails app

cd test/dummy
bundle
sudo rails s -p80

New Feature Ideas

Contributing to RGigya

Copyright © 2013 Cloudspace. See LICENSE.txt for further details.