SDK Quickstart
SDK Quickstart
We have a typescript SDK for users who prefer to interact with our api through typesafe methods.
Install the SDK through npm
npm install namestone-sdk
Initialize the Namestone client.
import NameStone, {
  AuthenticationError,
  NetworkError,
  NameData,
} from "namestone-sdk";

const ns = new NameStone("YOUR_API_KEY_HERE");
Then call with the relevant methods.
const domain = "testbrand.eth";

// Use an immediately invoked async function to allow top-level await
(async () => {
  try {
    const response: NameData[] = await ns.getNames({ domain: domain });
    console.log(response);
  } catch (error) {
    if (error instanceof AuthenticationError) {
      console.error("Authentication failed:", error.message);
    } else if (error instanceof NetworkError) {
      console.error("Network error:", error.message);
    } else {
      console.error("An unexpected error occurred:", error);
    }
  }
})();
Each of our api pages includes an SDK example and you can visit the SDK github for more information.