Official SDK Libraries

Native libraries for ping telemetry in your language. No HTTP boilerplate required.

🐘

PHP

v1.0.4

Clean PHP SDK with zero dependencies. Works with any framework or vanilla PHP.

composer require cronbeats/cronbeats-php
📗

Node.js

v0.1.4

TypeScript-first with full type definitions. Promise-based API with async/await support.

npm install @cronbeats/cronbeats-node
🐍

Python

v0.1.2

Pythonic API with context managers and type hints. Zero dependencies.

pip install cronbeats-python
💎

Ruby

v0.1.2

Idiomatic Ruby gem with clean method chaining. Works with Rails and standalone scripts.

gem install cronbeats-ruby
🐹

Go

v0.1.2

Lightweight Go package with explicit error handling. Zero external dependencies.

go get github.com/cronbeats/cronbeats-go

Why Use an SDK?

Clean, Idiomatic Code

No HTTP boilerplate. Use native language patterns and conventions.

Built-in Error Handling

Typed exceptions and normalized error codes. Handle failures gracefully.

Automatic Retries

Exponential backoff for network errors and rate limits. Zero configuration.

Type Safety

TypeScript definitions, type hints, and compile-time checks where applicable.

Fast Timeouts

Default 5-second timeout ensures your cron jobs never hang.

Zero Dependencies

Minimal footprint. All SDKs use only standard library HTTP clients.

SDK vs Raw HTTP

❌ Without SDK (Raw HTTP)

// Node.js example
const response = await fetch(
  'https://cronbeats.io/ping/abc123de/progress/50',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ message: 'Half done' })
  }
);
if (!response.ok) {
  // Handle errors manually
  throw new Error(`HTTP ${response.status}`);
}

✓ With SDK

// Same with SDK
const client = new PingClient('abc123de');

await client.progress(50, 'Half done');

// That's it! Errors handled automatically.

Installation

Each SDK is published to its language's standard package registry. Install using your package manager:

🐘 PHP
composer require cronbeats/cronbeats-php
📗 Node.js
npm install @cronbeats/cronbeats-node
🐍 Python
pip install cronbeats-python
💎 Ruby
gem install cronbeats-ruby
🐹 Go
go get github.com/cronbeats/cronbeats-go

Common SDK Patterns

Authentication

All SDKs use your job's ping key for authentication. Get your key from the dashboard:

  1. 1. Log in to cronbeats.com/dashboard
  2. 2. Click your job name
  3. 3. Copy the 8-character ping key (e.g., YCrXzYbV)
  4. 4. Pass it when creating the client: new PingClient('YCrXzYbV')

Error Handling

All SDKs throw typed exceptions for validation and API errors:

  • ValidationException/Error: Invalid job key format or parameters (client-side)
  • ApiException/Error: Network issues, rate limits, or server errors (includes HTTP status, error code, retry flag)

See language-specific pages for try-catch examples.

Timeouts & Retries

All SDKs include smart defaults to never block your cron jobs:

  • Timeout: 5 seconds (configurable)
  • Retries: Automatic for network errors, rate limits (429), and 5xx errors
  • Backoff: Exponential with jitter to avoid thundering herd

Prefer Raw HTTP Calls?

If you don't want to add an SDK dependency, you can call our endpoints directly using your language's native HTTP client.

See Ping API documentation for endpoint reference and examples in curl, PHP, Node.js, Python, Ruby, and Go.