Module: Rerout

Defined in:
lib/rerout.rb,
lib/rerout/qr.rb,
lib/rerout/error.rb,
lib/rerout/links.rb,
lib/rerout/client.rb,
lib/rerout/models.rb,
lib/rerout/project.rb,
lib/rerout/version.rb,
lib/rerout/webhooks.rb,
lib/rerout/qr_options.rb,
lib/rerout/create_link_input.rb,
lib/rerout/update_link_input.rb

Overview

Official Ruby SDK for the Rerout branded-link API.

Branded link infrastructure on Cloudflare — create short links, render QR codes, read analytics, and verify webhook signatures.

Examples:

Hello world

require 'rerout'

rerout = Rerout::Client.new(api_key: ENV.fetch('REROUT_API_KEY'))
link = rerout.links.create(
  Rerout::CreateLinkInput.new(target_url: 'https://example.com/sale')
)
puts link.short_url

See Also:

Defined Under Namespace

Modules: ClearSentinel, Models, OmitSentinel, Resources, Webhooks Classes: Client, CreateLinkInput, Error, QrOptions, UpdateLinkInput

Constant Summary collapse

DEFAULT_BASE_URL =

Default production API base URL.

'https://api.rerout.co'
VERSION =

Library version. Follows semantic versioning.

'0.1.0'
CLEAR =

Public sentinel — pass ‘Rerout::CLEAR` to a nullable field on UpdateLinkInput to send `null` on the wire.

Examples:

Rerout::UpdateLinkInput.new(seo_title: Rerout::CLEAR)
ClearSentinel
OMIT =

Internal default — distinguishes “not provided” from “set to nil”.

OmitSentinel

Class Method Summary collapse

Class Method Details

.verify_signature(raw_body:, signature_header:, secret:, tolerance_seconds: Webhooks::DEFAULT_TOLERANCE_SECONDS, now: nil) ⇒ Boolean

Module-level convenience matching the BRIEF’s free-function shape.

Returns:

  • (Boolean)

See Also:



128
129
130
131
132
133
134
135
136
137
138
# File 'lib/rerout/webhooks.rb', line 128

def self.verify_signature(raw_body:, signature_header:, secret:,
                          tolerance_seconds: Webhooks::DEFAULT_TOLERANCE_SECONDS,
                          now: nil)
  Webhooks.verify_signature(
    raw_body: raw_body,
    signature_header: signature_header,
    secret: secret,
    tolerance_seconds: tolerance_seconds,
    now: now
  )
end