npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openagentry/adapter-domain-namecheap

v0.1.0-alpha.0

Published

OpenAgentry DomainAdapter implementation for Namecheap

Readme

@openagentry/adapter-domain-namecheap

License: Apache-2.0 Status: Alpha

DomainAdapter for OpenAgentry, backed by the Namecheap XML API. The first concrete DomainAdapter in the OpenAgentry default adapter set.

Install

pnpm add @openagentry/adapter-domain-namecheap @openagentry/core

Quick start

Default export (env-based, lazy)

import domain from '@openagentry/adapter-domain-namecheap';

// Reads OA_NAMECHEAP_API_USER, OA_NAMECHEAP_API_KEY, OA_NAMECHEAP_CLIENT_IP from env
const avail = await domain.checkAvailability('example.com');
console.log(avail.available, avail.priceUsd);

Explicit construction

import { createNamecheapDomainAdapter } from '@openagentry/adapter-domain-namecheap';

const domain = createNamecheapDomainAdapter({
  apiUser: 'myuser',
  apiKey:  process.env.NC_API_KEY!,
  clientIp: '203.0.113.42',
  useSandbox: true,           // optional — sandbox endpoint
});

Configuration

| Env var | Required | Purpose | |---|---|---| | OA_NAMECHEAP_API_USER | yes | Namecheap API username | | OA_NAMECHEAP_API_KEY | yes | Namecheap API key (secret) | | OA_NAMECHEAP_CLIENT_IP | yes | Whitelisted IP sent on every request | | OA_NAMECHEAP_USERNAME | no | Domain-owner username (defaults to API_USER) | | OA_NAMECHEAP_USE_SANDBOX | no | 1 or true → sandbox endpoint | | OA_NAMECHEAP_ENDPOINT | no | Explicit endpoint override | | OA_NAMECHEAP_CONTACT_* | no* | Registrant contact fields (*required at purchase() time) |

Full env-var reference, sandbox setup, and SLD/TLD split notes: see LLM.md.

Sandbox vs. production. Set OA_NAMECHEAP_USE_SANDBOX=1 to route all calls to api.sandbox.namecheap.com. Sandbox credentials differ from production — obtain them at sandbox.namecheap.com. The integration test suite (tests/integration.test.ts) is gated on OA_NAMECHEAP_SANDBOX_API_USER, OA_NAMECHEAP_SANDBOX_API_KEY, and OA_NAMECHEAP_SANDBOX_CLIENT_IP to avoid accidentally hitting production.

API reference

All methods are declared on DomainAdapter in @openagentry/core. This adapter implements:

| Method | Signature | |---|---| | checkAvailability | (domain: string) => Promise<DomainAvailability> | | purchase | (domain: string, years?: number) => Promise<Domain> | | listRecords | (domain: string) => Promise<DnsRecord[]> | | setRecord | (domain: string, record: DnsRecord) => Promise<void> | | deleteRecord | (domain: string, record: DnsRecord) => Promise<void> | | initiateTransfer | (domain: string, authCode: string) => Promise<DomainTransfer> |

All failures throw AgentryError with stable codes: E_NAMECHEAP_AUTH, E_NAMECHEAP_IP_NOT_WHITELISTED, E_NAMECHEAP_DOMAIN_NOT_FOUND, E_NAMECHEAP_INVALID, E_NAMECHEAP_RATE_LIMIT, E_NAMECHEAP_NETWORK, E_NAMECHEAP_UPSTREAM.

Known limitations (v0)

  • Read-modify-write DNS. setRecord and deleteRecord use getHosts + setHosts (Namecheap replaces all records atomically). Concurrent writes to the same domain can lose updates. Callers must serialize.
  • Premium domain purchase blocked. checkAvailability surfaces the premium price, but purchase() rejects premium domains (E_NAMECHEAP_INVALID). Purchase via the Namecheap dashboard.
  • Single domain per checkAvailability call. The Namecheap API supports up to 50 in one call; the interface only accepts one at a time. Bulk support requires an interface change.
  • No WHOIS privacy, registrar-lock, or DNSSEC controls. Deferred to future plans.
  • IP whitelisting required. Add your server IP at Namecheap → Profile → Tools → API Access.

License

Apache-2.0.


See LLM.md for the concise operator reference (errors, gotchas, field mapping).