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

@namestone/namestone-sdk

v0.2.15

Published

A type-safe wrapper for the NameStone.xyz API

Readme

NameStone SDK

Type-safe SDK for interacting with the NameStone ENS subdomain API.

Installation

npm install @namestone/namestone-sdk

Quick Start

import NameStone from "@namestone/namestone-sdk";

// Initialize the client (API key optional for some methods)
const ns = new NameStone("YOUR_API_KEY");

// Example usage
async function getSubdomains() {
  const data = await ns.getNames({
    domain: "example.eth",
  });
  console.log(data);
}

API Reference

Authentication Methods

getSiweMessage

Generate a Sign-In with Ethereum (SIWE) message for authentication. Does not require an API key. Maps to the NameStone '/get-siwe-message' route.

const message = await ns.getSiweMessage({
  address: string,      // Your Ethereum address (must own the domain)
  domain?: string,      // Optional: Domain sending SIWE message (default: namestone.xyz)
  uri?: string         // Optional: URI sending SIWE message
});

enableDomain

Enable new domains for NameStone usage. Requires a signed SIWE message. Does not require an API key. Maps to the NameStone '/enable-domain' route.

const result = await ns.enableDomain({
  company_name: string,  // Your company name
  email: string,         // Email for API key delivery
  address: string,       // Domain owner's Ethereum address
  domain: string,        // Domain to enable (e.g., "brand.eth")
  signature: string,     // Signed SIWE message
  api_key?: string,      // Optional: Existing API key
  cycle_key?: "1"       // Optional: Set to "1" to cycle existing key
});

Domain Management

setDomain

Sets a domain with associated data. Maps to the NameStone '/set-domain' route.

await ns.setDomain({
  domain: string,           // Domain to configure
  address: string,          // Associated address
  contenthash?: string,     // Optional: Content hash
  text_records?: Record<string, string>  // Optional: Text records
});

getDomain

Retrieves domain data. Maps to the NameStone '/get-domain' route.

const domain = await ns.getDomain({
  domain: string, // Domain to query
});

Subdomain Management

setName

Sets a name with associated data. Maps to the NameStone '/set-name' route.

await ns.setName({
  name: string,             // Subdomain name
  domain: string,           // Parent domain
  address: string,          // Associated address
  contenthash?: string,     // Optional: Content hash
  text_records?: Record<string, string>,  // Optional: Text records
  coin_types?: Record<string, string>     // Optional: Coin types
});

getNames

Retrieves names based on specified criteria. Maps to the NameStone '/get-names' route.

const names = await ns.getNames({
  domain?: string,          // Optional: Filter by domain
  address?: string,         // Optional: Filter by address
  text_records?: boolean,   // Optional: Include text records
  limit?: number,           // Optional: Results limit
  offset?: number          // Optional: Pagination offset
});

searchNames

Searches for names based on specified criteria. Maps to the NameStone '/search-names' route.

const results = await ns.searchNames({
  domain: string,           // Domain to search within
  name: string,             // Search query
  text_records?: boolean,   // Optional: Include text records
  limit?: number,           // Optional: Results limit
  exact_match?: boolean,    // Optional: Require exact matches
  offset?: number          // Optional: Pagination offset
});

deleteName

Deletes a name from the specified domain. Maps to the NameStone '/delete-name' route.

await ns.deleteName({
  name: string, // Subdomain to delete
  domain: string, // Parent domain
});

Error Handling

All methods may throw:

  • AuthenticationError: When API key is invalid or missing
  • NetworkError: When API requests fails

Todo

  • [ ] Improve error handling