Skip to content

auditledge/auditledge-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

auditledge-ruby

Official Ruby SDK for Auditledge.

Install

gem install auditledge

Or in your Gemfile:

gem 'auditledge'

Quickstart

require 'auditledge'

client = Auditledge::Client.new('your_api_key')

client.log({
  actor: { id: 'user_123', name: 'Alice' },
  action: 'invoice.deleted',
  resource: { type: 'invoice', id: 'inv_456' },
  organization_id: 'org_789'
})

events = client.query(organization_id: 'org_789', limit: 50)

Rails Example

# config/initializers/auditledge.rb
AUDIT = Auditledge::Client.new(ENV['AUDITLEDGE_API_KEY'])

# In your controller
def destroy
  @invoice.destroy
  AUDIT.log({
    actor: { id: current_user.id.to_s, name: current_user.name },
    action: 'invoice.deleted',
    resource: { type: 'invoice', id: @invoice.id.to_s },
    organization_id: current_user.organization_id.to_s
  })
end

Links

License

MIT

About

Ruby SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages