Ruby SDK for Userbin
Userbin adds real-time monitoring of your authentication stack, instantly notifying you and your users on potential account hijacks.
userbin gem to your
Load and configure the library with your Userbin API secret in an initializer or similar.
Userbin.api_secret = 'YOUR_API_SECRET'
A Userbin client instance will automatically be made available as
userbin in your Rails, Sinatra or Padrino controllers.
Tracking security events
track lets you record the security-related actions your users perform. The more actions you track, the more accurate Userbin is in identifying fraudsters.
When you have access to a logged in user, send along the same user identifier as when you initiated Userbin.js.
userbin.track( user_id: user.id, name: 'login.succeeded')
If you don't have access to a logged in user just omit
user_id, typically when tracking failed logins.
All the available events are:
Userbin.configure do |config| # Same as setting it through Userbin.api_secret config.api_secret = 'secret' # Userbin::RequestError is raised when timing out (default: 30.0) config.request_timeout = 2.0 end