RGigya is an sdk wrapper around the Gigya Rest Api.
gem install rgigya
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.
You will need to setup your own dev site on the gigya platform for testing.
-
Go to platform.gigya.com/login.aspx to login.
-
Once you have logged into the platform. Click “add site”
-
Enter a domain and description and click add site
-
Remember the api key and secret for later
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'})
Create a file named ‘config/initializers/rgigya.rb` and add the following setup:
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'})
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} )
developers.gigya.com/037_API_reference/040_GM/gm.notifyAction
RGigya.gm_notifyAction(:uid => '1',:action => 'comment_upvote')
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)
We have included rspec unit tests.
Edit spec/spec_helper.rb
Replace <add api key here> with your api key Replace <add api secret here> with your api secret
cd <root of the project> rspec
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.
-
Edit app/views/layouts/application.html.erb
-
replace <add api key here> with your api key. You do NOT need a secret on this page.
-
replace the callback to be appropriate to your dev site.
-
In my case I added dev.rgigya.com to my hosts file and pointed it to localhost (127.0.0.1)
-
I then made the callback dev.rgigya.com/welcome.html in application.html.erb
-
-
-
Edit config/environments/development.rb and add the following constants
-
GIGYA_API_KEY = “<add api key here>”
-
GIGYA_API_SECRET = “<add api secret here>”
-
cd test/dummy bundle sudo rails s -p80
-
Rake tasks that help manage the data in gigya such as removing test users.
-
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.
-
Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.
-
Fork the project.
-
Start a feature/bugfix branch.
-
Commit and push until you are happy with your contribution.
-
Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright © 2013 Cloudspace. See LICENSE.txt for further details.