Move from Gumroad: 7% commission on every sale, Discover included

EXNO for developers

SDKs

Small, single-file clients for EXNO's REST API, with nothing else to install. Put one in your server-side app, set EXNO_API_KEY in its environment and call the API with safe retries, every page of a list and clear errors.

Choose your language

PHP

Needs
PHP 8.1+ with the curl extension
Version
1.0.0
SHA-256
70664b3d3b2f9ed0cf8c060b8742e6c1258208abac5271790e97dd72d81889ad
Download exno.php

Go

Needs
Go 1.21+, standard library only
Version
1.0.0
SHA-256
f42fd40863a893822673ad5ca6b14733d07842d213547f199ea5fe673a876f0f
Download exno.go

Quick start

JavaScript

exno.mjs
import { Exno } from "./exno.mjs";

const exno = new Exno(process.env.EXNO_API_KEY, { environment: "staging" });
console.log(await exno.me());
for await (const page of exno.pages("products", { limit: 25 })) console.log(page.data.length);

// a write: keep your own idempotency key to retry it safely
await exno.request("POST", "discounts", {
  body: { code: "LAUNCH20", percent_off: 20 }, idempotencyKey: savedKey,
});

Python

exno.py
import os
from exno import Exno

exno = Exno(os.environ["EXNO_API_KEY"], environment="staging")
print(exno.me())
for page in exno.pages("products", limit=25):
    print(len(page["data"]))

# a write: keep your own idempotency key to retry it safely
exno.request("POST", "discounts", body={"code": "LAUNCH20", "percent_off": 20}, idempotency_key=saved_key)

PHP

exno.php
<?php
require __DIR__ . '/exno.php';
use Exno\Exno;

$exno = new Exno(getenv('EXNO_API_KEY'), ['environment' => 'staging']);
print_r($exno->me());
foreach ($exno->pages('products', ['limit' => 25]) as $page) {
    echo count($page['data']), "\n";
}

// a write: keep your own idempotency key to retry it safely
$exno->request('POST', 'discounts', ['body' => ['code' => 'LAUNCH20', 'percent_off' => 20], 'idempotency_key' => $savedKey]);

// a webhook from a Created app or Developers › Webhooks
$event = Exno::verifyWebhook(file_get_contents('php://input'), $_SERVER['HTTP_EXNO_SIGNATURE'] ?? '', getenv('EXNO_SIGNING_SECRET'));

Go

exno.go
// copy exno.go into your module, for example internal/exno/exno.go
client, err := exno.New(os.Getenv("EXNO_API_KEY"), exno.WithEnvironment("staging"))
if err != nil {
	log.Fatal(err)
}
me, err := client.Me(ctx)
err = client.Pages(ctx, "products", map[string]string{"limit": "25"}, func(page map[string]any) error {
	fmt.Println(len(page["data"].([]any)))
	return nil
})

// a write: keep your own idempotency key to retry it safely
d, err := client.Request(ctx, http.MethodPost, "discounts", &exno.RequestOptions{
	Body: map[string]any{"code": "LAUNCH20", "percent_off": 20}, IdempotencyKey: savedKey})

// a webhook from a Created app or Developers › Webhooks
body, _ := io.ReadAll(r.Body)
event, err := exno.VerifyWebhook(body, r.Header.Get("Exno-Signature"), os.Getenv("EXNO_SIGNING_SECRET"), 5*time.Minute)

What every SDK does

  • Keep the key on your server: create it in Dashboard › Developers and set EXNO_API_KEY; never put it in a browser or an app.
  • Every write carries an Idempotency-Key. Pass your own and keep it to retry a write safely after a timeout; without one each call gets a new key. The SDKs never retry by themselves.
  • pages() (Pages in Go) walks a whole list by following next_cursor.
  • Errors carry the HTTP status, the error code and parameter, the request ID and, for 429, the Retry-After header.
  • Redirects are never followed and a call gives up after 30 seconds. production (exno.app) is the default; staging takes test keys.
  • PHP and Go also check webhook signatures: Exno::verifyWebhook() and exno.VerifyWebhook() take the raw body, the Exno-Signature header and your signing secret.

Webhooks without an SDK, and no-code tools: Zapier, Make, n8n and Pipedream.

Checksums

Compare a download with its SHA-256 before you use it. The JavaScript and Python files are listed in their own SHA256SUMS.

FileSHA-256
exno.php70664b3d3b2f9ed0cf8c060b8742e6c1258208abac5271790e97dd72d81889ad
exno.gof42fd40863a893822673ad5ca6b14733d07842d213547f199ea5fe673a876f0f

PHP, Go: SHA256SUMS · JavaScript, Python: SHA256SUMS

Local development

PHP's base_url and Go's WithBaseURL point an SDK at a local copy of EXNO for development. They take only http://127.0.0.1:<port> or http://localhost:<port>, so a key can't be sent anywhere else by mistake.

← All developer docs