Meerkat Agents

The official Ruby SDK for Meerkat Cloud.

Describe what you want to monitor, run it on demand or on a schedule, and receive structured change events in your dashboard or through a webhook.

Install

gem "meerkat-agents"
bundle install

Get an API key

  1. Sign up at cloud.meerkatagents.com/signup (email + password).
  2. Copy your API key (shown once).
export MEERKAT_API_KEY=mk_...

Create your first monitor

Webhook is optional — results appear in the Cloud dashboard and API.

require "meerkat"

client = Meerkat::Client.new(api_key: ENV.fetch("MEERKAT_API_KEY"))

monitor = client.monitors.create(
  description: "Tell me when this pricing page changes",
  input_params: { url: "https://example.com/pricing" },
  frequency: "every 6 hours"
)

Run it

run = client.monitors.run(monitor["data"]["id"])
puts run

Inspect findings in the Cloud dashboard under Runs, or:

client.monitors.artifacts(monitor_id, run_id)
client.monitors.retrieve_run(monitor_id, run_id)

Add a webhook (optional)

For production delivery to your Rails app:

client.monitors.update(
  monitor_id,
  output_webhook: "https://myapp.com/webhooks/meerkat"
)
class Webhooks::MeerkatController < ApplicationController
  include Meerkat::Rails::WebhookVerification

  def create
    payload = JSON.parse(request.raw_post)
    head :ok
  end
end

Set MEERKAT_WEBHOOK_SECRET for signature verification.

Configuration

Variable Description
MEERKAT_API_KEY From Cloud signup
MEERKAT_WEBHOOK_SECRET HMAC verification (when using webhooks)
MEERKAT_BASE_URL Optional; defaults to Cloud

Docs