Skip to content

keithyoder/autentique-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Autentique Ruby Gem

A Ruby client for the Autentique digital signature API. This gem provides a clean, idiomatic interface to Autentique's GraphQL API for document signing and management.

CI Security Gem Version Ruby

Features

  • πŸ” Simple Authentication β€” Easy API key configuration
  • πŸ“„ Document Management β€” Create, retrieve, list, and delete documents
  • ✍️ Flexible Signing β€” Multiple signers with various authentication methods
  • πŸ“ Folder Management β€” Organize documents in folders
  • πŸͺ Webhook Processing β€” Verify and process incoming Autentique webhook events
  • πŸ–οΈ Sandbox Mode β€” Test without consuming document credits
  • πŸ›‘οΈ Type Safety β€” Model classes for structured data

Installation

Add to your Gemfile:

gem 'autentique'

Then run bundle install, or install directly with gem install autentique.

Quick Start

client = Autentique::Client.new(api_key: ENV['AUTENTIQUE_API_KEY'])

# Create a document
document = client.documents.create(
  file: '/path/to/contract.pdf',
  document: { name: 'Employment Contract' },
  signers: [{ email: 'employee@example.com', action: 'SIGN' }]
)

puts document.id
puts document.signatures.first.short_link

# Retrieve a document
doc = client.documents.find('document-uuid')
puts doc.signed? ? 'Signed' : 'Pending'

# Process an incoming webhook
processor = Autentique::WebhookProcessor.new(
  request.body.read,
  secret: ENV['AUTENTIQUE_WEBHOOK_SECRET'],
  signature: request.headers['X-Autentique-Signature']
)

processor.process do |event_type, data|
  puts "#{event_type}: #{data['id']}"
end

Configuration

Environment variable

client = Autentique::Client.new(api_key: ENV['AUTENTIQUE_API_KEY'])

Global configuration (recommended for Rails)

Autentique.configure do |config|
  config.api_key = Rails.application.credentials.dig(:autentique, :api_key)
  config.sandbox = Rails.env.development? || Rails.env.test?
end

client = Autentique.client

Rails initializer

Create config/initializers/autentique.rb:

Autentique.configure do |config|
  config.api_key = Rails.application.credentials.dig(:autentique, :api_key)
  config.sandbox = Rails.env.development? || Rails.env.test?
end

Error Handling

begin
  document = client.documents.create(...)
rescue Autentique::AuthenticationError => e
  # Invalid or missing API key
rescue Autentique::RateLimitError => e
  # 60 requests/minute limit exceeded
rescue Autentique::ValidationError => e
  # Invalid input
rescue Autentique::QueryError => e
  # GraphQL query failed β€” e.errors contains details
rescue Autentique::UploadError => e
  # File upload failed
rescue Autentique::InvalidSignatureError => e
  # Webhook signature verification failed
rescue Autentique::WebhookError => e
  # Unknown webhook event type or processing error
rescue Autentique::Error => e
  # Base class for all gem errors
end

Documentation

Testing

bundle exec rspec
COVERAGE=true bundle exec rspec

Development

git clone https://github.com/keithyoder/autentique-ruby.git
cd autentique-ruby
bundle install
bundle exec rspec
gem build autentique.gemspec

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

Resources

License

Available as open source under the MIT License.

Acknowledgments

This gem is not officially maintained by Autentique. It is a community-driven project to simplify Ruby integration with the Autentique API.

Support

Changelog

See CHANGELOG.md.

About

Ruby gem for the Autentique digital signature API.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages