Skip to content
Pidgely Docs

SDKs & tools

SDKs

Official Pidgely SDKs for Go (published), Node.js, Python, PHP and Ruby (preview) - install, configure and send your first email.

View as Markdown
Language Install Repository Status
Go go get github.com/pidgely/pidgely-go pidgely/pidgely-go v0.1 — published
Node.js / TypeScript npm install pidgely pidgely/pidgely-node Preview (0.1) — publishing soon
Python pip install pidgely pidgely/pidgely-python Preview (0.1) — publishing soon
PHP composer require pidgely/pidgely-php guzzlehttp/guzzle pidgely/pidgely-php Preview (0.1) — publishing soon
Ruby gem install pidgely pidgely/pidgely-ruby Preview (0.1) — publishing soon

All SDKs share the same resources and method names (emails.send, emails.get, batch.send, domains.create, domains.verify, apiKeys.create, contacts.*, segments.*, broadcasts.*, templates.*, webhooks.*, suppressions.*), adapted to each language's conventions. Every page of the API reference shows the call in each language.

Node.js

Shell
npm install pidgely
JavaScript
import { Pidgely } from 'pidgely';

const pidgely = new Pidgely(process.env.PIDGELY_API_KEY); // or set PIDGELY_API_KEY and call new Pidgely()

const { data, error } = await pidgely.emails.send({
  from: 'Acme <onboarding@acme.com>',
  to: ['delivered@example.com'],
  subject: 'Hello from Pidgely',
  html: '<p>It works!</p>',
});

if (error) console.error(error); // { statusCode, name, message }
else console.log(data.id);
  • Zero dependencies, uses the global fetch: Node.js 18+, Bun, Deno, Cloudflare Workers, Vercel Edge.
  • Never throws on API or network errors: methods resolve to { data, error, headers }.
  • Idempotency and retries: send methods accept { idempotencyKey }; requests are retried with backoff (honouring Retry-After) up to maxRetries (default 2). A POST without an idempotency key is never retried after a 5xx or network error.
  • Inputs in camelCase (replyTo, scheduledAt, segmentId), responses exactly as the API returns them.
  • React Email: pass react instead of html (renders with @react-email/render).
  • Webhook verification: await verifyWebhook({ payload, headers, webhookSecret }) (see Webhooks).
JavaScript
const pidgely = new Pidgely(process.env.PIDGELY_API_KEY, {
  baseUrl: 'https://api.pidgely.com', // or PIDGELY_BASE_URL
  timeout: 30_000, // per attempt, ms
  maxRetries: 2,
});

Python

Shell
pip install pidgely
Python
import os
import pidgely

pidgely.api_key = os.environ["PIDGELY_API_KEY"]

email = pidgely.Emails.send({
    "from": "Acme <onboarding@acme.com>",
    "to": ["delivered@example.com"],
    "subject": "Hello from Pidgely",
    "html": "<p>It works!</p>",
})

PHP

Shell
# Guzzle is the suggested HTTP client; any PSR-18 client works
composer require pidgely/pidgely-php guzzlehttp/guzzle
PHP
<?php
require __DIR__ . '/vendor/autoload.php';

$pidgely = Pidgely::client(getenv('PIDGELY_API_KEY'));

$email = $pidgely->emails->send([
    'from' => 'Acme <onboarding@acme.com>',
    'to' => ['delivered@example.com'],
    'subject' => 'Hello from Pidgely',
    'html' => '<p>It works!</p>',
]);

Go

Shell
go get github.com/pidgely/pidgely-go
Go
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/pidgely/pidgely-go"
)

func main() {
	ctx := context.Background()
	client := pidgely.NewClient(os.Getenv("PIDGELY_API_KEY"))

	sent, err := client.Emails.Send(ctx, &pidgely.SendEmailRequest{
		From:    "Acme <onboarding@acme.com>",
		To:      []string{"delivered@example.com"},
		Subject: "Hello from Pidgely",
		Html:    "<p>It works!</p>",
	}, pidgely.WithIdempotencyKey("hello-1"))
	if err != nil {
		panic(err) // *pidgely.Error carries StatusCode and Name
	}
	fmt.Println(sent.Id)
}

Request options such as pidgely.WithIdempotencyKey(…) and pidgely.WithBatchValidation(pidgely.BatchPermissive) go after the request; list methods take *pidgely.ListParams (or nil).

Ruby

Shell
gem install pidgely
Ruby
require "pidgely"

Pidgely.api_key = ENV["PIDGELY_API_KEY"]

email = Pidgely::Emails.send({
  from: "Acme <onboarding@acme.com>",
  to: ["delivered@example.com"],
  subject: "Hello from Pidgely",
  html: "<p>It works!</p>"
})

Plain HTTP

Every API reference page also has the raw request as cURL. The OpenAPI document (JSON) describes the whole API and can generate a client for any other language.

Coming from another provider?

Moving existing code from Resend? See Migrate from Resend.