touchmark
v0.2.0
Published
Official TypeScript client for the Touchmark API: email, IP and phone validation.
Maintainers
Readme
touchmark
Official TypeScript client for the Touchmark API: email validation and mailbox checks, sender readiness, IP lookup and phone number validation. ESM, typed, no runtime dependencies; Node 20+, edge runtimes, Deno and Bun.
npm install touchmarkimport { Touchmark, TouchmarkError } from "touchmark"
const tm = new Touchmark({ apiKey: process.env.TOUCHMARK_API_KEY })
const email = await tm.email.validate({ email: "[email protected]" })
const ip = await tm.ip.lookup({ ip: "203.0.113.7" })
const phone = await tm.phone.validate({ phone: "020 7946 0000", country: "GB" })
const check = await tm.email.verify({ email: "[email protected]" })
const done = check.status === "done" ? check : await tm.email.waitForVerification(check.id!)- Every call costs the credits of the API call it makes; see the API reference.
- Errors throw
TouchmarkErrorwithstatus,code,detail,requestIdandretryAfter. - Each charged call sends an
Idempotency-Key(a random one, or yours:tm.ip.lookup(body, { idempotencyKey })), so the API charges it at most once. - A key belongs to one request: reuse it only to retry that same call, with the same SDK. Another body or endpoint, or more than 10 replays, answers
422 idempotency_key_reused. - Network errors and
429,409 idempotency_key_in_use,500,502,503and504answers are retried with the same key and body, at most twice; other errors are not. - If you show IP country or network data to anyone, keep the credit "IP Geolocation by DB-IP" (https://db-ip.com) next to it.
Using the Touchmark API is subject to the Terms of Service and the Acceptable Use Policy. The client sends requests only to the API base URL and includes no telemetry.
MIT licence. The licence covers the code only and grants no rights to the Touchmark name or logo.
