Project

bigshield

0.0
The project is in a healthy, maintained state
Ruby SDK for the BigShield email validation API. Provides multi-signal risk scoring to detect fake signups, burner emails, disposable domains, and other fraudulent email patterns.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

BigShield Ruby SDK

Official Ruby SDK for the BigShield email validation API. Detect fake signups, burner emails, and disposable domains with 30+ detection signals.

Requirements

  • Ruby 3.0+
  • net-http (stdlib)

Installation

gem install bigshield

Or add to your Gemfile:

gem "bigshield"

Quick Start

require "bigshield"

client = BigShield::Client.new("ev_live_...")
result = client.validate("user@example.com")

puts result.risk_score       # 0-100
puts result.fraud_decision   # "allow" | "block" | "review" | "require_verification"
puts result.recommendation   # "accept" | "review" | "reject"

raise "Please use a valid email address" if result.fraud_decision == "block"

Configuration

# Simple
client = BigShield::Client.new("ev_live_...")

# Advanced options
client = BigShield::Client.new(
  "ev_live_...",
  base_url: "https://bigshield.app",  # default
  timeout: 30,                         # request timeout in seconds
  retries: 2                           # retry on 5xx errors
)

Methods

validate(email, **options) -> ValidationResult

Validate a single email address.

result = client.validate(
  "user@example.com",
  ip: request.remote_ip,
  user_agent: request.user_agent,
  fingerprint: client_fingerprint,
  wait: true,                                # long-poll for async signals
  webhook_url: "https://myapp.com/webhook",
  metadata: { source: "signup" }
)

puts result.fraud_decision
puts result.fraud_flags   # e.g. ["proxy_ip", "burner_domain"]
puts result.signals       # individual signal results

batch_validate(emails, **options) -> BatchValidateResponse

Validate multiple emails in a single request. Max batch size depends on your plan.

batch = client.batch_validate(
  ["user1@gmail.com", "fake@tempmail.com", "real@company.org"],
  ip: request.remote_ip
)

blocked = batch.results.select { |r| r.fraud_decision == "block" }
puts "Blocked #{blocked.size} of #{batch.total} emails"

get_validation(id) -> ValidationResult

Retrieve a previous validation result by ID.

result = client.get_validation("val_a1b2c3d4")

wait_for_completion(id, interval:, max_attempts:) -> ValidationResult

Poll until async signals complete.

initial = client.validate("user@example.com")

if initial.status == "partial"
  final = client.wait_for_completion(
    initial.id,
    interval: 1.0,      # poll every 1s
    max_attempts: 30     # give up after 30s
  )
end

get_usage -> UsageStats

Get current usage statistics.

usage = client.get_usage
puts "#{usage.usage.total} / #{usage.usage.limit} validations used"

health -> HealthResponse

Check API health status.

health = client.health
puts health.status

register_webhook(url, events:) -> Hash

Register a webhook URL for validation events.

client.register_webhook("https://myapp.com/webhook", events: ["validation.completed"])

Error Handling

require "bigshield"

begin
  result = client.validate("test@example.com")
rescue BigShield::AuthError
  # Invalid or missing API key (401)
rescue BigShield::RateLimitError => e
  # Rate limit exceeded (429)
  puts "Retry after #{e.retry_after} seconds"
rescue BigShield::Error => e
  # Other API error
  puts "#{e.code} #{e.status} #{e.message}"
end

Documentation

Full API documentation is available at bigshield.app/docs.

License

MIT