Skip to main content

SDK Reference

Full API reference for zerodrop-client.

Installation

ZeroDrop class

Parameters

Without an API key, ZeroDrop runs in free sandbox mode with a shared domain and 30-minute TTL.

generateInbox()

Generates a unique inbox address instantly. No network request.

waitForLatest()

Waits for an email to arrive. Uses SSE for sub-second delivery, falls back to polling automatically. Throws ZeroDropTimeoutError if no email arrives within the timeout.

Options


fetchLatest()

Fetches the latest email without waiting. Returns null if the inbox is empty.

ZeroDropEmail type

otp

4-8 digit numeric code extracted from the email body. Detected near labels like code, otp, pin, verification. null if not detected.
Verification or reset URL extracted from the email body. Detected for URLs containing verify, confirm, reset, token, activate, or auth. null if not detected.

Error types

ZeroDropTimeoutError

Thrown when no email arrives within the timeout.

ZeroDropNetworkError

Thrown when the API is unreachable. Includes a link to the status page.

ZeroDropAuthError

Thrown when an invalid API key is provided.

Zero telemetry

The SDK does not send analytics, usage metrics, or environment data to any server. The only network requests made are explicit inbox polls to zerodrop.dev/api/inbox/{name}. Your CI pipeline is your business.