The NameGuard SDK is open source and can be installed using your dependency manager.

Install

Instantiate

NameGuard exports a singleton that can be imported that has the defaults instantiated already, these defaults are:

  • URL: https://api.nameguard.io
  • Network: mainnet
import { nameguard } from "@namehash/nameguard";

Configure Chain

You can customize the chain used by using the createClient method, and passing your desired networkSee supported chains.

import { createClient } from "@namehash/nameguard";

const nameguard = createClient({
  network: "sepolia",
});

Custom Client

If you’re working locally with or have self-hosted the NameGuard API, you’ll need to update the url for the API by creating a custom client.

import { createClient } from "@namehash/nameguard";

const nameguard = createClient({
  url: "http://localhost:5000",
});