Skip to content

Ruby SDK

The official HookBridge SDK for Ruby provides a simple way to integrate with HookBridge.

Add to your Gemfile:

gem 'hookbridge'

Then run:

Terminal window
bundle install

Or install directly:

Terminal window
gem install hookbridge
require "hookbridge"
client = HookBridge.new(api_key: "YOUR_API_KEY")
# Create an endpoint
endpoint = client.create_endpoint(
url: "https://your-app.com/webhooks",
description: "My webhook endpoint"
)
# Send a webhook
result = client.send(
endpoint_id: endpoint.id,
payload: {
event: "user.created",
data: { user_id: "123", email: "user@example.com" }
}
)
puts "Message sent: #{result.message_id}"

Configure HookBridge in an initializer:

config/initializers/hookbridge.rb
$hookbridge = HookBridge.new(
api_key: Rails.application.credentials.hookbridge_api_key
)
Personalize Examples

Enter your credentials to populate code examples throughout the docs.