# Overview

Welcome to the JustaName documentation. This guide covers everything you need to know about integrating and using  the **JustWeb3 Widget , React SDK** and the [**Admin Dashboard**](https://dashboard.justaname.id/) to manage your ENS subnames and engage with your community. The documentation is organized into the following sections:

**React SDK**:  Access low-level hooks for complete flexibility, build custom flows tailored to your app's needs.

{% content-ref url="/pages/LlSjUg4z4zeUHrb47Pws" %}
[React sdk](/react-sdk/overview)
{% endcontent-ref %}

**Plug n Play**: The quickest path to integration. Drop in our pre-built widget and customize everything from appearance to ENS subname issuance, social verifications, and network settings.

{% content-ref url="/pages/RxyyyIPeROyPcHZXgDpi" %}
[Plug n Play (Widget)](/plug-n-play-widget/overview)
{% endcontent-ref %}

\
**Learn & Engage**: Explore the Admin Dashboard, where you can monitor and manage subname data, filter user information, and gain insights to engage with your community more effectively.

{% content-ref url="/pages/jYeOjW51tNjADQHk7GSg" %}
[Learn & Engage](/learn-and-engage/overview)
{% endcontent-ref %}

**Use Cases**: Explore practical examples of how JustaName can be utilized across different industries and platforms, highlighting the platform's flexibility in decentralized applications.

{% content-ref url="/pages/GrRL9QUqkUUx9zi2Izz9" %}
[Broken mention](broken://pages/GrRL9QUqkUUx9zi2Izz9)
{% endcontent-ref %}

This documentation will guide you through every aspect of the JustaName platform, empowering you to leverage the widget and dashboard to optimize your platform’s user experience and engagement.


# Overview

Use hooks directly in your React app for full control over the UI and user experience. Build custom flows for subname claiming, profile management, and ENS resolution, tailored exactly to your app.

**Quickstart:** A fast and easy setup guide to help you integrate the JustaName React SDK and start building custom ENS experiences in your application.

{% content-ref url="/pages/zwDdUaruqc2J4Fn09Ag9" %}
[Quickstart](/react-sdk/quickstart)
{% endcontent-ref %}

**Check Availability**: Verify if a subname is available before allowing users to claim it. Includes best practices for debouncing user input.

{% content-ref url="/pages/JoXWbBBZzfIgD9H5vQqM" %}
[Check Availability](/react-sdk/check-availability)
{% endcontent-ref %}

**Issue Subnames**: Claim and issue new subnames off-chain using the `useAddSubname` hook. Handles wallet signatures and API communication automatically.

{% content-ref url="/pages/rrglnOeKirqsClnnPYkn" %}
[Issue Subnames](/react-sdk/issue-subnames)
{% endcontent-ref %}

**Update Subnames**: Update ENS records including text records (avatar, bio, socials) and multi-chain addresses. Includes `toCoinType` usage for EVM chain address storage.

{% content-ref url="/pages/A95E8v9QYB2xtBEsitfV" %}
[Update Subnames](/react-sdk/update-subnames)
{% endcontent-ref %}

**Resolution:** Resolve any ENS name to retrieve all associated records—text records, coin addresses, and content hash—in a single call using `useRecords`.

{% content-ref url="/pages/rXkitTGd1pBshvfKsbYb" %}
[Resolution](/react-sdk/resolution)
{% endcontent-ref %}

***

**Reverse Resolution:** Look up the primary ENS name for any Ethereum address using `usePrimaryName`. Includes L2 primary name support with `toCoinType`.

{% content-ref url="/pages/PsSw9f8L7fYo1myTenwn" %}
[Reverse Resolution](/react-sdk/reverse-resolution)
{% endcontent-ref %}

**Get Subnames:** Fetch all subnames owned by the connected account or any arbitrary address using `useAccountSubnames` and `useAddressSubnames`.

{% content-ref url="/pages/sqoiF0Y8uNcc9UWnsgRT" %}
[Get All Subnames for an Owner](/react-sdk/get-all-subnames-for-an-owner)
{% endcontent-ref %}

***

#### Installation

{% tabs %}
{% tab title="npm" %}

```bash
npm install @justaname.id/react
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add @justaname.id/react
```

{% endtab %}
{% endtabs %}


# Quickstart

0\. Prerequisites

In order to integrate the JustaName React SDK, your project must run on:

* A minimum React version of **18**
* A minimum TypeScript version of **4** (optional but recommended)

***

### 1. Install the React SDK

Install the latest version of the JustaName React SDK using your package manager of choice:

{% tabs %}
{% tab title="npm" %}

```bash
npm install @justaname.id/react
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add @justaname.id/react
```

{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm install @justaname.id/react
```

{% endtab %}
{% endtabs %}

***

### 2. Create an Account

#### 2.1. Sign Up

Navigate to the [Admin Dashboard](https://dashboard.justaname.id/) and follow the simple sign-up process to create your account.

#### 2.2. Configure ENS Domain

Once your workspace is set up, configure your ENS domain.\
If you don't own an ENS domain, you can purchase one during this step.

***

### 3. Generate an API Key

After setting up your account, you can now issue an API key:

1. In the dashboard, go to the **API Key** section.
2. Generate your API key and make sure to save it securely, we won't be able to retrieve it for you later if it's lost.

**Congratulations!**\
You're all set. Now, you can move forward with configuring the SDK.

### 4. SDK Configuration

To use the JustaName React SDK, wrap your application with the `JustaNameProvider`. This component provides all child components access to the JustaName context, enabling seamless interaction with ENS services.

**Setup with `JustaNameProvider`**

Wrap your application with `JustaNameProvider` to enable ENS services across all child components.

```tsx
'use client';
import "@rainbow-me/rainbowkit/styles.css";
import '@justweb3/widget/styles.css';
import {
  getDefaultConfig,
  getDefaultWallets,
  RainbowKitProvider,
} from "@rainbow-me/rainbowkit";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { WagmiProvider } from "wagmi";
import { mainnet, sepolia } from "wagmi/chains";
import {
  JustWeb3Provider,
  JustWeb3ProviderConfig,
} from "@justweb3/widget";
import { JustaNameProvider } from '@justaname.id/react';
import type { JustaNameProviderConfig } from "@justaname.id/react";
import { JustVerifiedPlugin } from '@justverified/plugin';
import { ChainId } from '@justaname.id/sdk';
import { AddSubname } from './AddSubname';

const { wallets } = getDefaultWallets();

const config = getDefaultConfig({
  appName: 'JustaName Console',
  projectId: 'YOUR_PROJECT_ID',
  wallets: [
    ...wallets,
    {
      groupName: 'Other',
      wallets: [argentWallet, trustWallet, ledgerWallet],
    },
  ],
  chains: [mainnet, sepolia],
  ssr: true,
});


const justanameConfig: JustaNameProviderConfig = {
        config: {
            origin,
            domain: domain || 'localhost',
        },
        networks: [
            {
                chainId: 1,
                providerUrl: mainnetProviderUrl || '',
            },
        ],
        ensDomains:[{
            ensDomain: mainnetEnsDomain,
            chainId: 1,
            apiKey:  mainnetApiKey,
        }],
    };


const queryClient = new QueryClient();

export const App = () => {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <RainbowKitProvider>
          <JustaNameProvider config={justnameConfig}>
              <AddSubname />
          </JustaNameProvider>
        </RainbowKitProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}

```

### 5. You're all set! 🎉

You now have access to all the React SDK hooks. Continue to the next sections to learn about:

* Checking subname availability
* Issuing subnames
* Updating records
* ENS resolution
* Reverse resolution
* Fetching subnames by owner


# Check Availability

Before allowing users to claim a subname, you'll want to check if it's already taken. The `useIsSubnameAvailable` hook queries JustaName's registry to determine availability in real-time.

#### How It Works

The hook accepts a `username` parameter (the subname without the parent domain) and returns:

* `isSubnameAvailable`: Boolean indicating if the name is free to claim
* `isLoading`: Boolean for loading state during the check

#### Best Practice: Debouncing

Since users type character-by-character, you should debounce the input to avoid excessive API calls. This improves performance and reduces unnecessary network requests.

```tsx
import { useIsSubnameAvailable } from '@justaname.id/react';
import { useState } from 'react';
import { useDebounce } from '@uidotdev/usehooks';

export const CheckAvailability = () => {
  const [username, setUsername] = useState('');
  
  // Wait 500ms after user stops typing before checking
  const debouncedUsername = useDebounce(username, 500);
  
  const { isSubnameAvailable, isLoading } = useIsSubnameAvailable({
    username: debouncedUsername
  });

  return (
    <div>
      <input
        value={username}
        onChange={(e) => setUsername(e.target.value)}
        placeholder="Enter username"
      />
      {isLoading && <span>Checking...</span>}
      {!isLoading && debouncedUsername && (
        <span>{isSubnameAvailable ? '✅ Available' : '❌ Taken'}</span>
      )}
    </div>
  );
};
```


# Issue Subnames

Once you've confirmed a subname is available, use `useAddSubname` to claim it. This hook handles the entire claiming flow including wallet signature requests and API communication.

#### How It Works

When `addSubname` is called:

1. The SDK requests a challenge from JustaName's SIWE (Sign-In with Ethereum) endpoint
2. The user signs the challenge message with their wallet
3. The signed message is sent to JustaName to register the subname
4. The subname is immediately available for resolution

#### Signature-Free Onboarding

For a smoother onboarding experience, you can use `overrideSignatureCheck` to issue subnames without requiring the user to sign a message. This is useful when you want to reduce friction during user registration, allowing you to assign subnames instantly without wallet pop-ups.

#### The Hook Returns

* `addSubname`: Async function to trigger the claim
* `isPending`: Boolean indicating if a claim is in progress
* `isSuccess`: Boolean indicating successful completion
* `error`: Any error that occurred during the process

```tsx
import { useAddSubname, useIsSubnameAvailable } from '@justaname.id/react';
import { useState } from 'react';
import { useDebounce } from '@uidotdev/usehooks';
import { ConnectButton } from '@rainbow-me/rainbowkit';
import { useAccount } from 'wagmi';

export const ClaimSubname = () => {
  const { isConnected } = useAccount();
  const [username, setUsername] = useState('');
  const debouncedUsername = useDebounce(username, 500);
  
  const { isSubnameAvailable } = useIsSubnameAvailable({
    username: debouncedUsername
  });
  
  const { addSubname, isPending } = useAddSubname();

  const handleClaim = async () => {
    try {
      const result = await addSubname({ username });
      console.log('Subname claimed:', result);
      // result contains the full subname record
    } catch (error) {
      console.error('Failed to claim subname:', error);
    }
  };

  return (
    <div>
      <h2>Claim your subname</h2>
      <ConnectButton />
      <input
        value={username}
        onChange={(e) => setUsername(e.target.value)}
        placeholder="Enter username"
      />
      <button
        onClick={handleClaim}
        disabled={!isSubnameAvailable || !isConnected || !debouncedUsername || isPending}
      >
        {isPending ? 'Claiming...' : 'Claim'}
      </button>
    </div>
  );
};
```


# Update Subnames

After claiming a subname, users can enrich their ENS profile by adding records. The `useUpdateSubname` hook allows updating text records (avatar, social handles, bio) and coin addresses (multi-chain wallet addresses).

#### Understanding ENS Records

ENS supports several record types:

* **Text Records**: Key-value pairs for metadata (avatar, description, social links)
* **Coin Addresses**: Wallet addresses for different blockchains
* **Content Hash**: IPFS/IPNS links for decentralized websites

#### Adding Text Records

Common text record keys include:

* `avatar` – Profile picture URL (or NFT reference)
* `description` – Bio or about text
* `com.twitter` – Twitter/X handle
* `com.github` – GitHub username
* `url` – Personal website

```tsx
import { useUpdateSubname } from '@justaname.id/react';

export const UpdateProfile = () => {
  const { updateSubname, isPending } = useUpdateSubname();

  const handleUpdate = async () => {
    await updateSubname({
      username: 'myusername',
      text: [
        { key: 'avatar', value: 'https://example.com/avatar.png' },
        { key: 'description', value: 'Web3 developer and ENS enthusiast' },
        { key: 'com.twitter', value: 'myhandle' },
        { key: 'com.github', value: 'mygithub' },
        { key: 'url', value: 'https://mywebsite.com' },
      ]
    });
  };

  return (
    <button onClick={handleUpdate} disabled={isPending}>
      {isPending ? 'Updating...' : 'Update Profile'}
    </button>
  );
};
```

#### Adding Multi-chain Addresses

ENS supports storing addresses for multiple blockchains using **coin types** defined in SLIP-44 and ENSIP-11. This enables a single ENS name to resolve to different addresses on different chains.

**Understanding Coin Types**

* **SLIP-44 coin types**: Used for non-EVM chains (Bitcoin = 0, Ethereum = 60, Solana = 501)
* **ENSIP-11 coin types**: Used for EVM-compatible chains, derived from the chain ID

Viem provides a `toCoinType` helper that converts EVM chain IDs to the correct ENSIP-11 coin type format.

```tsx
import { useUpdateSubname } from '@justaname.id/react';
import { toCoinType } from 'viem';
import { base, arbitrum, optimism, polygon } from 'viem/chains';

export const UpdateMultichainAddresses = () => {
  const { updateSubname, isPending } = useUpdateSubname();

  const handleUpdate = async () => {
    await updateSubname({
      username: 'myusername',
      coins: [
        // Standard SLIP-44 coin types
        { id: 60, value: '0x1234...5678' },           // Ethereum
        { id: 0, value: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh' },  // Bitcoin
        { id: 501, value: 'DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK' }, // Solana
        
        // EVM chains using toCoinType (converts chainId to ENSIP-11 format)
        { id: toCoinType(base.id), value: '0xabcd...efgh' },      // Base
        { id: toCoinType(arbitrum.id), value: '0xijkl...mnop' },  // Arbitrum
        { id: toCoinType(optimism.id), value: '0xqrst...uvwx' },  // Optimism
        { id: toCoinType(polygon.id), value: '0x9876...5432' },   // Polygon
      ]
    });
  };

  return (
    <button onClick={handleUpdate} disabled={isPending}>
      {isPending ? 'Updating...' : 'Update Addresses'}
    </button>
  );
};
```

> **Why `toCoinType`?** EVM chains share the same address format, so ENSIP-11 defines a formula to derive coin types from chain IDs: `coinType = 0x80000000 | chainId`. The `toCoinType` function handles this conversion automatically.\
> Learn more about coinType [here](https://docs.ens.domains/ensip/11).


# Resolution

Resolution is the process of looking up data associated with an ENS name. The `useRecords` hook fetches **all records** for any ENS name in a single call, including text records, coin addresses, and content hash.

#### What You Get

The hook returns a comprehensive `records` object containing:

* `resolverAddress`: The contract handling resolution for this name
* `texts`: Array of all text records (`{ key, value }`)
* `coins`: Array of all coin addresses (`{ id, name, value }`)
* `contentHash`: Decentralized content pointer (IPFS, IPNS, etc.)

This is particularly useful for building profile pages or displaying complete ENS identity information.

tsx

```tsx
import { useRecords } from '@justaname.id/react';

export const ENSProfile = ({ ensName }: { ensName: string }) => {
  const { records, isLoading, error } = useRecords({ ens: ensName });

  if (isLoading) return <div>Loading profile...</div>;
  if (error) return <div>Error loading profile</div>;
  if (!records) return <div>No records found for {ensName}</div>;

  return (
    <div className="ens-profile">
      <h2>{ensName}</h2>
      
      {/* Display avatar if available */}
      {records.texts?.find(t => t.key === 'avatar') && (
        <img 
          src={records.texts.find(t => t.key === 'avatar')?.value} 
          alt="Avatar" 
        />
      )}
      
      {/* Text Records Section */}
      <section>
        <h3>Profile Information</h3>
        {records.texts?.map((text) => (
          <div key={text.key}>
            <strong>{text.key}:</strong> {text.value}
          </div>
        ))}
      </section>
      
      {/* Addresses Section */}
      <section>
        <h3>Wallet Addresses</h3>
        {records.coins?.map((coin) => (
          <div key={coin.id}>
            <strong>{coin.name} (coinType: {coin.id}):</strong>
            <code>{coin.value}</code>
          </div>
        ))}
      </section>
      
      {/* Content Hash */}
      {records.contentHash && (
        <section>
          <h3>Decentralized Website</h3>
          <p>
            <strong>Protocol:</strong> {records.contentHash.protocolType}
          </p>
          <p>
            <strong>Hash:</strong> {records.contentHash.decoded}
          </p>
        </section>
      )}
    </div>
  );
};
```

#### Records Response Structure

```typescript
interface Records {
  resolverAddress: string;
  texts: Array<{ key: string; value: string }>;
  coins: Array<{ 
    id: number;      // Coin type (60 for ETH, 0 for BTC, etc.)
    name: string;    // Human-readable name
    value: string;   // The address
  }>;
  contentHash: {
    protocolType: string;  // 'ipfs', 'ipns', 'bzz', etc.
    decoded: string;       // The actual hash/CID
  } | null;
}
```


# Reverse Resolution

Reverse resolution is the opposite of forward resolution, instead of looking up an address from a name, you look up the reverse record associated with an address. This is essential for displaying human-readable names in your UI instead of raw addresses.

#### Using useReverseResolve

The useReverseResolve hook handles reverse resolution for Ethereum addresses with ENSIP-19 multichain support:

```tsx
import { useReverseResolve } from '@justaname.id/react';

export const UserIdentity = ({ address }: { address: string }) => {
  const { ensName, isReverseResolveLoading } = useReverseResolve({ address });

  if (isReverseResolveLoading) return <span>Loading...</span>;

  // Display the ENS name if available, otherwise show truncated address
  return (
    <span>
      {ensName || `${address.slice(0, 6)}...${address.slice(-4)}`}
    </span>
  );
};
```

#### Multichain Resolution

The hook uses a three-level fallback strategy for resolution:

1. Try with coinType 0 (default Ethereum)
2. Try with coinType based on chainId (multichain per ENSIP-19)
3. Fallback to JustaName offchain records

```tsx
const { ensName } = useReverseResolve({
  address: '0x1234...abcd',
  chainId: 8453, // Base chain
});
```


# Get All Subnames for an Owner

Sometimes you need to fetch all subnames associated with a particular owner, for example, to display a user's complete ENS portfolio or to build admin interfaces for subname management.

#### For the Connected Account

Use `useAccountSubnames` to fetch subnames owned by the currently connected wallet:

tsx

```tsx
import { useAccountSubnames } from '@justaname.id/react';

export const MySubnames = () => {
  const { accountSubnames, isLoading } = useAccountSubnames();

  if (isLoading) return <div>Loading your subnames...</div>;
  
  if (!accountSubnames?.length) {
    return <div>You don't have any subnames yet.</div>;
  }

  return (
    <div>
      <h3>My Subnames ({accountSubnames.length})</h3>
      <ul>
        {accountSubnames.map((subname) => (
          <li key={subname.ens}>
            <strong>{subname.ens}</strong>
            <span>Claimed: {new Date(subname.claimedAt).toLocaleDateString()}</span>
          </li>
        ))}
      </ul>
    </div>
  );
};
```

#### For Any Address

Use `useAddressSubnames` when you need to look up subnames for an arbitrary address (not necessarily the connected user):

tsx

```tsx
import { useAddressSubnames } from '@justaname.id/react';

export const AddressSubnames = ({ address }: { address: string }) => {
  const { addressSubnames, isLoading } = useAddressSubnames({ address });

  if (isLoading) return <div>Loading subnames...</div>;

  return (
    <div>
      <h3>Subnames for {address.slice(0, 6)}...{address.slice(-4)}</h3>
      
      {addressSubnames?.length === 0 && (
        <p>No subnames found for this address.</p>
      )}
      
      {addressSubnames?.map((item) => (
        <div key={item.ensSubname.ens} className="subname-card">
          <h4>{item.ensSubname.ens}</h4>
          <p>Parent Domain: {item.ensDomain}</p>
          <p>Total subnames under this domain: {item.subnameCount}</p>
          {item.ensSubname.isClaimed && (
            <p>Claimed: {new Date(item.ensSubname.claimedAt).toLocaleDateString()}</p>
          )}
        </div>
      ))}
    </div>
  );
};
```

#### Response Structure

The `useAddressSubnames` hook returns data grouped by parent domain:

typescript

```typescript
interface AddressSubnameItem {
  ensDomain: string;        // Parent domain (e.g., "yourdomain.eth")
  subnameCount: number;     // Total subnames under this domain
  ensSubname: {
    ens: string;            // Full subname (e.g., "user.yourdomain.eth")
    isClaimed: boolean;
    claimedAt: string;      // ISO date string
    isJAN: boolean;         // Is it a JustaName subname?
    records: Records;       // Full record set
  };
}
```


# Demo

#### Complete Integration Demo

For a full working example that demonstrates all the concepts covered in this documentation, check out our official demo repository:

**🔗** [**JustaName React Integration Demo**](https://github.com/JustaName-id/justaname-react-integration-demo)

This repository includes:

* Complete provider setup with RainbowKit
* Subname claiming flow with availability checking
* Profile management with record updates
* ENS resolution and display components<br>

#### Additional Resources

* Full react-sdk reference - <https://docs.justaname.id/sdk-reference/justaname-react-sdk>


# Forward Resolution

Resolve an ENS name into its address(es) and records. Given `vitalik.eth`, returns the address behind it, the avatar, the Twitter handle, and any other record. For the opposite direction (address → name), see [Reverse Resolution](/resolution/reverse-resolution)

### Endpoint

```
GET /ens/v2/resolve
```

**Base URL:** `https://api.justaname.id`

### Quick start<br>

The endpoint is **free** when you supply your own RPC URL via the `rpcUrl` query parameter. No API key required. Rate-limited to 30 requests per 60 seconds per IP.

```bash
curl "https://api.justaname.id/ens/v2/resolve?ens=vitalik.eth&rpcUrl=https://eth.drpc.org"
```

```typescript
const url = new URL('https://api.justaname.id/ens/v2/resolve');
url.searchParams.append('ens', 'vitalik.eth');
url.searchParams.append('rpcUrl', process.env.RPC_URL!);

const res = await fetch(url);
```

The caller's RPC pays for the on-chain reads. JustaName performs resolution through the ENS Universal Resolver with CCIP-Read support and returns the decoded records.

> **Autonomous clients without an RPC URL** (AI agents, MCP servers, scripts) can pay per-request in USDC on Base instead of supplying `rpcUrl`. See [#programmatic-access-without-an-rpc-url](#programmatic-access-without-an-rpc-url "mention").

### Parameters

| Parameter | Type                  | Required  | Description                                                                                                                                                                             |
| --------- | --------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ens`     | `string` (repeatable) | Yes       | ENS name to resolve. Repeat to batch up to **50** names (`?ens=a.eth&ens=b.eth`). Append `@<chain>` to scope to a single chain — see [#interop-addresses](#interop-addresses "mention") |
| `rpcUrl`  | `string`              | See below | HTTPS RPC URL used to perform the on-chain resolution.                                                                                                                                  |

Either `rpcUrl` must be present **or** the request must carry a valid payment header. Without either, the endpoint returns `402` with a payment challenge — see [#programmatic-access-without-an-rpc-url](#programmatic-access-without-an-rpc-url "mention").

### Interop addresses

By default, resolution returns every address attached to the name across every chain in `records.addresses`. To scope the result to a single chain, append a chain suffix to the name:

| Format                 | Effect                              |
| ---------------------- | ----------------------------------- |
| `vitalik.eth`          | Returns all addresses on all chains |
| `vitalik.eth@ethereum` | Returns only the Ethereum address   |
| `vitalik.eth@eip155:1` | Returns only the Ethereum address   |

Both the human-readable chain name and the CAIP-2 form (`eip155:<chainId>`) are accepted. The suffix is per-name, so a batch can mix scoped and unscoped lookups:

```
?ens=vitalik.eth&ens=nick.eth@ethereum&rpcUrl=...
```

When a suffix is present, `records.addresses` contains at most one entry — the address for the requested chain, or an empty array if the name has no record for that chain.

### RPC URL requirements

* Must be HTTPS.
* Private, loopback, and link-local hosts are rejected.
* Embedded credentials (`https://user:pass@host`) are rejected.

### Response

Returns a single object when one `ens` is requested, or an array (in input order, `null` for hard-failed slots) when multiple are requested.

```ts
type ResolveResponse = {
  statusCode: number;
  result: {
    data: ResolveResult | (ResolveResult | null)[] | null;
    error: string | null;
  };
};

type ResolveResult = {
  ens: string;
  isClaimed?: boolean;
  claimedAt?: string | null;
  isJAN: boolean;
  viaUniversalResolver: boolean;
  records: {
    resolverAddress: string;
    texts: { key: string; value: string }[];
    addresses: { id: number; name: string; value: string }[];
    contentHash: { protocolType: string; decoded: string } | null;
  };
};
```

#### Single name

```json
{
  "statusCode": 200,
  "result": {
    "data": {
      "ens": "vitalik.eth",
      "isClaimed": false,
      "isJAN": false,
      "viaUniversalResolver": true,
      "records": {
        "resolverAddress": "0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",
        "texts": [
          { "key": "com.twitter", "value": "VitalikButerin" },
          { "key": "url", "value": "https://vitalik.ca" }
        ],
        "addresses": [
          { "id": 60, "name": "eth", "value": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }
        ],
        "contentHash": null
      }
    },
    "error": null
  }
}
```

#### Batch

```json
{
  "statusCode": 200,
  "result": {
    "data": [
      { "ens": "vitalik.eth", "records": { "...": "..." }, "viaUniversalResolver": true, "isJAN": false },
      null,
      { "ens": "nick.eth", "records": { "...": "..." }, "viaUniversalResolver": true, "isJAN": false }
    ],
    "error": null
  }
}
```

### Behavior

* Resolution is performed through the on-chain ENS Universal Resolver with CCIP-Read support.
* The caller supplies the RPC URL — the service does not pay for the on-chain reads.
* Batch failures are localized: a hard-failed slot becomes `null` while the rest succeed.
* Unregistered names do **not** return `null`. Wildcard resolvers return an object with `records.addresses: []`.
* Duplicate names in a batch are not deduplicated — each slot is resolved independently.
* `viaUniversalResolver: true` confirms the ENSv2-ready resolver path was used.

### Reading records

Pull the L1 wallet, avatar, and a social handle from a batch result:

```ts
const url = new URL('https://api.justaname.id/ens/v2/resolve');
['vitalik.eth', 'nick.eth', 'ens.eth'].forEach((n) => url.searchParams.append('ens', n));
url.searchParams.append('rpcUrl', process.env.RPC_URL!);

const res = await fetch(url);

const { result } = (await res.json()) as ResolveResponse;
if (result.error) throw new Error(result.error);

const items = result.data as (ResolveResult | null)[];
for (const r of items) {
  if (!r) continue;
  const eth = r.records.addresses.find((a) => a.id === 60)?.value;
  const avatar = r.records.texts.find((t) => t.key === 'avatar')?.value;
  const twitter = r.records.texts.find((t) => t.key === 'com.twitter')?.value;
  console.log(r.ens, { eth, avatar, twitter });
}
```

### Errors

| Status        | When                                                                                  |
| ------------- | ------------------------------------------------------------------------------------- |
| `400`         | `rpcUrl` not HTTPS, has embedded credentials, or resolves to a private/loopback host. |
| `400`         | `ens` array empty or > 50 entries.                                                    |
| `429`         | Rate limit (30 req / 60 s per IP) exceeded. Body includes `retryAfterSeconds`.        |
| `502` / `504` | RPC provider error or CCIP-Read gateway timeout.                                      |

Payment-related statuses (`402`, `503`) are documented in the paid path section.

***

### Programmatic access without an RPC URL

For clients that don't manage their own RPC infrastructure — AI agents, MCP servers, autonomous scripts — the endpoint accepts per-request payment in place of `rpcUrl`. The service performs the on-chain reads and charges the caller in USDC on Base.

Two protocols are accepted on the same route. Clients pick whichever fits their stack:

* **x402 v2** — Coinbase's HTTP-payment protocol. See [x402.org](https://x402.org).
* **MPP-charge** — IETF Internet-Draft [`draft-httpauth-payment-00`](https://paymentauth.org/draft-httpauth-payment-00.html) with EVM method [`draft-evm-charge-00`](https://github.com/tempoxyz/mpp-specs). Co-authored by Tempo Labs and Stripe.

Both protocols settle identically — a signed EIP-3009 `transferWithAuthorization` submitted by a facilitator on Base. They differ only in HTTP envelope.

|           |                                                          |
| --------- | -------------------------------------------------------- |
| **Chain** | Base mainnet (`eip155:8453`)                             |
| **Asset** | USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)      |
| **Price** | `1000` base units per request (0.001 USDC at 6 decimals) |

#### 402 challenge

A request without `rpcUrl` and without a payment header receives both challenges in one response. The headers are disjoint, so they coexist:

```
HTTP/1.1 402 Payment Required
Content-Type: application/json
PAYMENT-REQUIRED: <base64 JSON — x402 v2 challenge>
WWW-Authenticate: Payment id="<uuid>", realm="api.justaname.id", method="evm", intent="charge", request="<base64url-nopad JSON — MPP challenge>"
```

Decoded `PAYMENT-REQUIRED` (x402 v2):

```json
{
  "x402Version": 2,
  "resource": {
    "url": "https://api.justaname.id/ens/v2/resolve?ens=vitalik.eth",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "1000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x...",
      "maxTimeoutSeconds": 60
    }
  ],
  "extensions": { "bazaar": { "info": "...", "schema": "..." } },
  "error": "PAYMENT-SIGNATURE header is required"
}
```

Decoded `WWW-Authenticate` `request=` (MPP `draft-evm-charge-00`):

```json
{
  "network": "eip155:8453",
  "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "1000",
  "recipient": "0x...",
  "credentialTypes": ["eip3009"]
}
```

#### Paying

Sign an EIP-3009 `transferWithAuthorization` against the USDC contract on Base (e.g. `viem`'s `signTypedData` with `primaryType: "TransferWithAuthorization"` and a fresh 32-byte `nonce`). Wrap the signed message in either envelope and retry the request:

| Scheme     | Request header                                  | Receipt header (on 200)                   |
| ---------- | ----------------------------------------------- | ----------------------------------------- |
| x402 v2    | `PAYMENT-SIGNATURE: <base64 JSON>`              | `PAYMENT-RESPONSE: <base64 JSON>`         |
| MPP-charge | `Authorization: Payment <base64url-nopad JSON>` | `Payment-Receipt: <base64url-nopad JSON>` |

The facilitator submits the on-chain tx and pays gas — the payer only needs USDC, not ETH.

#### Idempotency, replay, validity

* Set `Idempotency-Key: <uuid>` on every retry. Without it, each retry is a fresh payment.
* `(nonce, recipient)` is locked in a 5-minute LRU. Always sign with a fresh random `nonce`.
* `validBefore` should be \~10 min from `now()`. Longer windows risk re-sending stale signatures past expiry.
* A retriable failure (facilitator transient error) returns `503` + `Retry-After`. Repeat the same request.
* A non-retriable failure (malformed payload, replay, network/asset mismatch) returns a fresh `402` with the reason in the challenge.

#### Discovery

* `GET /ens/v2/pricing` *(free)* — JSON list of paid routes: `{ path, method, schemes, amount, asset, network, recipient }`.
* `GET /.well-known/x402.json` *(free)* — x402 manifest (`services[]` + `accepts[]`) for catalog crawlers (Bazaar, x402scan).
* `GET /openapi.json` — OpenAPI document. Each paid operation carries `x-payment-info: { offers: [{ amount, currency, description, intent, method }] }` per `draft-payment-discovery-00`.

#### Payment-path errors

| Status | When                                                                                                                      |
| ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `402`  | Request lacks `rpcUrl` and no payment header was supplied. `PAYMENT-REQUIRED` and `WWW-Authenticate` carry the challenge. |
| `402`  | Payment proof was malformed, replayed, expired, or targeted the wrong network/asset.                                      |
| `503`  | Facilitator transient error during verify/settle. `Retry-After` set; repeat the same request.                             |


# Reverse Resolution

Resolve an address into its ENS reverse record on a given chain. Given `0xd8dA6BF…`, returns `vitalik.eth` so you can show a name instead of a hex string. For the opposite direction (name → address and records), see [Forward Resolution](/resolution/forward-resolution).

### Endpoint

```
GET /ens/v2/reverse
```

**Base URL:** `https://api.justaname.id`

### Quick start

The endpoint is **free** when you supply your own RPC URL via the `rpcUrl` query parameter. No API key required. Rate-limited to 30 requests per 60 seconds per IP.

```bash
curl "https://api.justaname.id/ens/v2/reverse?address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045&coinType=60&rpcUrl=https://eth.drpc.org"
```

```ts
const url = new URL('https://api.justaname.id/ens/v2/reverse');
url.searchParams.append('address', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045');
url.searchParams.set('coinType', '60');
url.searchParams.set('rpcUrl', process.env.RPC_URL!);

const res = await fetch(url);
```

To get the full profile in the same call, add `records=true`. The response then includes every record set on the resolved name (text records, addresses, contenthash) alongside it:

```bash
curl "https://api.justaname.id/ens/v2/reverse?address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045&coinType=60&records=true&rpcUrl=https://eth.drpc.org"
```

\
\
The caller's RPC pays for the on-chain reads. JustaName performs the reverse lookup through the ENS Universal Resolver and falls back to its off-chain reverse-record store when no on-chain reverse record is set.

> **Autonomous clients without an RPC URL** (AI agents, MCP servers, scripts) can pay per-request in USDC on Base instead of supplying `rpcUrl`. See [#programmatic-access-without-an-rpc-url](#programmatic-access-without-an-rpc-url "mention").

### Parameters

| Parameter  | Type                  | Required    | Description                                                                                                                                                                                                                                            |
| ---------- | --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `address`  | `string` (repeatable) | Yes         | Address to reverse-resolve. Repeat to batch up to **50** addresses (`?address=0x…&address=0x…`). Plain (`0x…`) or interop-formatted — see [#interop-addresses](#interop-addresses "mention").                                                          |
| `coinType` | `number`              | Conditional | ENSIP-19 coinType — see [#cointype-reference](#cointype-reference "mention"). Required for plain addresses; optional when every address in the batch carries an interop suffix.                                                                        |
| `rpcUrl`   | `string`              | See below   | HTTPS RPC URL used to perform the on-chain resolution.                                                                                                                                                                                                 |
| `records`  | `boolean`             | No          | Default `false`. When `true`, fetches all records set on each resolved name (text records, addresses, contenthash) and returns them in the response. Applies to every address in a batch. Skipped for addresses with no reverse record (`name: null`). |

Either `rpcUrl` must be present **or** the request must carry a valid payment header. Without either, the endpoint returns `402` with a payment challenge — see [#programmatic-access-without-an-rpc-url](#programmatic-access-without-an-rpc-url "mention").

### Interop addresses

By default, the request-level `coinType` applies to every address in the batch. To override per-slot — for example, when batching addresses across different chains — append a chain suffix to the address:

| Format                             | Effect                                     |
| ---------------------------------- | ------------------------------------------ |
| `0xd8dA…6045` (with `coinType=60`) | Reverse on Ethereum                        |
| `0xd8dA…6045@ethereum`             | Reverse on Ethereum (overrides `coinType`) |
| `0xd8dA…6045@eip155:1`             | Reverse on Ethereum (overrides `coinType`) |
| `0xbbb…@eip155:8453`               | Reverse on Base                            |

Both the human-readable chain name and the CAIP-2 form (`eip155:<chainId>`) are accepted. The suffix is per-address, so a batch can mix suffixed and request-level-scoped slots:

```
?address=0xaaa…@eip155:1&address=0xbbb…@eip155:8453&address=0xccc…&coinType=10&rpcUrl=...
```

When every address in the batch carries a suffix, the request-level `coinType` becomes optional.

### RPC URL requirements

Same as Forward Resolution: HTTPS only, no private/loopback/link-local hosts, no embedded credentials.

### coinType reference

ENSIP-19 coinTypes follow the formula `0x80000000 | chainId` for EVM L2 primaries. Ethereum mainnet is the exception (`60`).

| Chain                              | Decimal      | Hex          |
| ---------------------------------- | ------------ | ------------ |
| Ethereum mainnet                   | `60`         | `0x3c`       |
| Optimism                           | `2147483658` | `0x8000000a` |
| Base                               | `2147492837` | `0x80002105` |
| Arbitrum One                       | `2147525809` | `0x8000a4b1` |
| ENSIP-19 default (step-2 fallback) | `2147483648` | `0x80000000` |

### Response

Returns a single object when one `address` is requested, or an array of slot-level objects (with per-slot `error`) when multiple are requested.

```ts
type ReverseResponse = {
  statusCode: number;
  result: {
    data: ReverseResult | ReverseBatchResult[] | null;
    error: string | null;
  };
};

type ReverseResult = {
  address: string;
  name: string | null;
  coinType: number;
  viaUniversalResolver: boolean;
};

type ReverseBatchResult = {
  address: string;
  name: string | null;
  coinType: number | null;
  viaUniversalResolver: boolean;
  error: string | null;
};
```

#### Single address

```json
{
  "statusCode": 200,
  "result": {
    "data": {
      "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
      "name": "vitalik.eth",
      "coinType": 60,
      "viaUniversalResolver": true
    },
    "error": null
  }
}
```

#### Batch

```json
{
  "statusCode": 200,
  "result": {
    "data": [
      {
        "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "name": "vitalik.eth",
        "coinType": 60,
        "viaUniversalResolver": true,
        "error": null
      },
      {
        "address": "0xb965a5f3a0fc18d84e68883ccad508445a7917a8",
        "name": null,
        "coinType": null,
        "viaUniversalResolver": true,
        "error": "coinType is required for plain addresses"
      }
    ],
    "error": null
  }
}
```

### Behavior

For each address, a 3-step fallback chain is walked. The first hit wins:

1. On-chain reverse lookup with the supplied `coinType` (or the coinType derived from the interop suffix).
2. On-chain reverse lookup with the ENSIP-19 default coinType (`0x80000000`) — covers L2 names with a chain-agnostic reverse record.
3. JustaName off-chain reverse-record store.

Other notes:

* `viaUniversalResolver: true` → resolved on-chain (step 1 or 2). `viaUniversalResolver: false` → resolved from the JustaName off-chain store (step 3).
* `name: null` is a normal outcome (most addresses do not have a reverse record set), not a failure.
* In batch mode, slot failures are localized: the slot returns `name: null` with a populated `error`, and the rest of the batch succeeds.
* For batch slots that fail preflight (malformed interop suffix, unsupported chain label, missing `coinType` for a plain address), `coinType` is `null`.

### Labelling a multi-chain list

```ts
const inputs = [
  '0xaaa...@eip155:1',     // mainnet
  '0xbbb...@eip155:8453',  // Base
  '0xccc...@eip155:10',    // Optimism
];

const url = new URL('https://api.justaname.id/ens/v2/reverse');
inputs.forEach((a) => url.searchParams.append('address', a));
url.searchParams.set('rpcUrl', process.env.RPC_URL!);

const res = await fetch(url);

const { result } = (await res.json()) as ReverseResponse;
if (result.error) throw new Error(result.error);

const items = result.data as ReverseBatchResult[];
for (const item of items) {
  if (item.error) {
    console.warn(item.address, item.error);
    continue;
  }
  console.log(item.address, '→', item.name ?? '(no reverse record)');
}
```

### Errors

| Status        | When                                                                                  |
| ------------- | ------------------------------------------------------------------------------------- |
| `400`         | `rpcUrl` not HTTPS, has embedded credentials, or resolves to a private/loopback host. |
| `400`         | `address` malformed (not `0x[40-hex]` optionally followed by `@<chain>`).             |
| `400`         | `address` array empty or > 50 entries.                                                |
| `400`         | Single-address request with a plain address and no `coinType`.                        |
| `400`         | Unknown chain label in the interop suffix.                                            |
| `429`         | Rate limit (30 req / 60 s per IP) exceeded. Body includes `retryAfterSeconds`.        |
| `502` / `504` | RPC provider error or CCIP-Read gateway timeout.                                      |

Payment-related statuses (`402`, `503`) are documented in the paid path section.

***

### Programmatic access without an RPC URL

For clients that don't manage their own RPC infrastructure — AI agents, MCP servers, autonomous scripts — the endpoint accepts per-request payment in place of `rpcUrl`. The service performs the on-chain reads and charges the caller in USDC on Base.

Two protocols are accepted on the same route. Clients pick whichever fits their stack:

* **x402 v2** — Coinbase's HTTP-payment protocol. See [x402.org](https://x402.org).
* **MPP-charge** — IETF Internet-Draft [`draft-httpauth-payment-00`](https://paymentauth.org/draft-httpauth-payment-00.html) with EVM method [`draft-evm-charge-00`](https://github.com/tempoxyz/mpp-specs). Co-authored by Tempo Labs and Stripe.

Both protocols settle identically — a signed EIP-3009 `transferWithAuthorization` submitted by a facilitator on Base. They differ only in HTTP envelope.

|           |                                                          |
| --------- | -------------------------------------------------------- |
| **Chain** | Base mainnet (`eip155:8453`)                             |
| **Asset** | USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)      |
| **Price** | `1000` base units per request (0.001 USDC at 6 decimals) |

#### 402 challenge

A request without `rpcUrl` and without a payment header receives both challenges in one response. The headers are disjoint, so they coexist:

```
HTTP/1.1 402 Payment Required
Content-Type: application/json
PAYMENT-REQUIRED: <base64 JSON — x402 v2 challenge>
WWW-Authenticate: Payment id="<uuid>", realm="api.justaname.id", method="evm", intent="charge", request="<base64url-nopad JSON — MPP challenge>"
```

Decoded `PAYMENT-REQUIRED` (x402 v2):

```json
{
  "x402Version": 2,
  "resource": {
    "url": "https://api.justaname.id/ens/v2/reverse?address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&coinType=60",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "1000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x...",
      "maxTimeoutSeconds": 60
    }
  ],
  "extensions": { "bazaar": { "info": "...", "schema": "..." } },
  "error": "PAYMENT-SIGNATURE header is required"
}
```

Decoded `WWW-Authenticate` `request=` (MPP `draft-evm-charge-00`):

```json
{
  "network": "eip155:8453",
  "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "1000",
  "recipient": "0x...",
  "credentialTypes": ["eip3009"]
}
```

#### Paying

Sign an EIP-3009 `transferWithAuthorization` against the USDC contract on Base (e.g. `viem`'s `signTypedData` with `primaryType: "TransferWithAuthorization"` and a fresh 32-byte `nonce`). Wrap the signed message in either envelope and retry the request:

| Scheme     | Request header                                  | Receipt header (on 200)                   |
| ---------- | ----------------------------------------------- | ----------------------------------------- |
| x402 v2    | `PAYMENT-SIGNATURE: <base64 JSON>`              | `PAYMENT-RESPONSE: <base64 JSON>`         |
| MPP-charge | `Authorization: Payment <base64url-nopad JSON>` | `Payment-Receipt: <base64url-nopad JSON>` |

The facilitator submits the on-chain tx and pays gas — the payer only needs USDC, not ETH.

#### Idempotency, replay, validity

* Set `Idempotency-Key: <uuid>` on every retry. Without it, each retry is a fresh payment.
* `(nonce, recipient)` is locked in a 5-minute LRU. Always sign with a fresh random `nonce`.
* `validBefore` should be \~10 min from `now()`. Longer windows risk re-sending stale signatures past expiry.
* A retriable failure (facilitator transient error) returns `503` + `Retry-After`. Repeat the same request.
* A non-retriable failure (malformed payload, replay, network/asset mismatch) returns a fresh `402` with the reason in the challenge.

#### Discovery

* `GET /ens/v2/pricing` *(free)* — JSON list of paid routes: `{ path, method, schemes, amount, asset, network, recipient }`.
* `GET /.well-known/x402.json` *(free)* — x402 manifest (`services[]` + `accepts[]`) for catalog crawlers (Bazaar, x402scan).
* `GET /openapi.json` — OpenAPI document. Each paid operation carries `x-payment-info: { offers: [{ amount, currency, description, intent, method }] }` per `draft-payment-discovery-00`.

#### Payment-path errors

| Status | When                                                                                                                      |
| ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `402`  | Request lacks `rpcUrl` and no payment header was supplied. `PAYMENT-REQUIRED` and `WWW-Authenticate` carry the challenge. |
| `402`  | Payment proof was malformed, replayed, expired, or targeted the wrong network/asset.                                      |
| `503`  | Facilitator transient error during verify/settle. `Retry-After` set; repeat the same request.                             |


# Overview

This section covers four key areas of configuration:

**Quickstart**: A fast and easy setup guide to help you integrate the JustWeb3 Widget and get started with issuing ENS subnames on your platform.

{% content-ref url="/pages/25Kz0Txlg1HI98fJ03dZ" %}
[Quickstart](/plug-n-play-widget/quickstart)
{% endcontent-ref %}

**Appearance**: Customize the widget's color scheme and branding, including primary colors, background, and logos, to match your dApp's design.

{% content-ref url="/pages/Dwmx3YBqXaRlfg5BxvsG" %}
[Appearance](/plug-n-play-widget/appearance)
{% endcontent-ref %}

**JustVerified Plugin**: Enable social verification by allowing users to authenticate via platforms like Twitter, GitHub, Discord, Telegram, or email for added security and trust.

{% content-ref url="/pages/Fv8SJGKps8rQ1gLj9t9e" %}
[JustVerified](/plug-n-play-widget/justverified)
{% endcontent-ref %}

**Allowed ENS Names**: Control how users sign in with ENS names. You can allow all ENS names, restrict sign-ins to subnames from a specific domain, or specify multiple ENS domains.

{% content-ref url="/pages/M9eyCVNR7Hd8dd6Ql4Fg" %}
[Allowed ENS Names](/plug-n-play-widget/allowed-ens-names)
{% endcontent-ref %}

**ENS Domains**: Configure the ENS domains your platform will use for issuing and managing subnames. By default, `justan.id` for mainnet and `justan.eth` for testnet are used, but you can specify your own ENS domain along with the required API key to manage subnames for your platform.

{% content-ref url="/pages/zYCOuXZj5sDNzlomGBUh" %}
[ENS Domains](/plug-n-play-widget/ens-domains)
{% endcontent-ref %}

**Network Configuration**: Define custom network providers for **mainnet** and **sepolia**, or default to public RPC URLs if none are specified.

{% content-ref url="/pages/hf9xY7H3GsbnV9asFDsR" %}
[Networks](/plug-n-play-widget/networks)
{% endcontent-ref %}


# Quickstart

The JustWeb3 Widget is the easiest way to get the best digital identity suite in your dApp.

In under 5 minutes of setup and customization, you can start:

* Issuing free branded subnames to your userbase
* Enabling them to edit and manage their profile in a cryptographically secured way
* Freeing your dApp from sybil actors with the use of social verifications and ZK-KYC

While we take care of setting up your admin dashboard in the background, to provide you with the best analytics, enabling you to learn about your community and start engaging them via our trusted decentralized mediums.

### 0. Prerequisites

In order to Integrate the JustWeb3 Widget, your project must run on:

* a [minimum react version of 18](https://react.dev/learn/start-a-new-react-project)
* a minimun typescript version of 4

### 1. Install the JustWeb3 Widget

Install the latest version of the [JustWeb3 Widget ](https://www.npmjs.com/package/@justweb3/widget)using your package manager of choice:

{% tabs %}
{% tab title="npm" %}

```bash
npm install @justweb3/widget
```

{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm install @justweb3/widget
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add @justweb3/widget
```

{% endtab %}
{% endtabs %}

### 2. Create an Account

#### 2.1. Sign Up:

Navigate to the [Admin Dashboard](https://dashboard.justaname.id/) and follow the simple sign-up process to create your account.

#### 2.2. Configure ENS Domain:

* Once your workspace is set up, configure your ENS domain.
* If you don’t own an ENS domain, you can purchase one during this step.

### 3. Generate an API Key

After having set up your account, you can now issue an api key:

* In the dashboard, go to the API Key section.
* Generate your API key and make sure to **save it securely**—we won't be able to retrieve it for you later if it’s lost.

**Congratulations!**\
You're all set. Now, you can move forward with configuring the widget.

### 4. Widget Configuration

In your project, import the JustWeb3Provider component and wrap your app with it.

An example set up for a [NextJs](https://nextjs.org/) or a [React Vite](https://vite.dev/guide/) project, can be found below:<br>

{% hint style="info" %}
Please note the below example uses [RainbowKit](https://www.rainbowkit.com/). You can replace it with any web3 wallet provider. ([WalletConnect](https://explorer.walletconnect.com/), [Web3Auth](https://web3auth.io/), [Privy](https://www.privy.io/) ...)
{% endhint %}

#### Next Js

{% tabs %}
{% tab title="Provider.tsx" %}

```typescript
'use client';

import "@rainbow-me/rainbowkit/styles.css";
import '@justweb3/widget/styles.css';
import {
  getDefaultConfig,
  getDefaultWallets,
  RainbowKitProvider,
} from "@rainbow-me/rainbowkit";
import {
  argentWallet,
  ledgerWallet,
  trustWallet,
} from "@rainbow-me/rainbowkit/wallets";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { WagmiProvider } from "wagmi";
import { mainnet, sepolia } from "wagmi/chains";
import {
  JustWeb3Provider,
  JustWeb3ProviderConfig,
  JustWeb3Button,
} from "@justweb3/widget";
import { ConnectButton } from "@rainbow-me/rainbowkit";

export default function Providers({children}: {children: React.ReactNode}) {
 const { wallets } = getDefaultWallets();

  const config = getDefaultConfig({
    appName: "RainbowKit demo",
    projectId: "YOUR_PROJECT_ID",
    wallets: [
      ...wallets,
      {
        groupName: "Other",
        wallets: [argentWallet, trustWallet, ledgerWallet],
      },
    ],
    chains: [mainnet, sepolia],
    ssr: true,
  });

  const justweb3Config: JustWeb3ProviderConfig = {
    config: {
      origin: "http://localhost:3000/",
      domain: "localhost",
      signInTtl: 86400000,
    },
    openOnWalletConnect: true,
    allowedEns: "all",
    logo: "",
    ensDomains: [
      {
        ensDomain: "YOUR ENS DOMAIN",
        apiKey: "YOUR JUSTANAME API KEY",
        chainId: 1,
      },
    ],
    color: {
      primary: "hsl(216, 90%, 58%)",
      background: "hsl(0, 0%, 100%)",
      destructive: "hsl(0, 100%, 50%)",
    },
  };

  const queryClient = new QueryClient();

  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <RainbowKitProvider>
          <JustWeb3Provider config={justweb3Config}>
            {children}
          </JustWeb3Provider>
        </RainbowKitProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
};

export default Providers;
```

{% endtab %}

{% tab title="layout.tsx" %}

```typescript
// Wrap the Provider to access the widget across the app

return (
    <html lang="en">
      <body
        className={`${geistSans.variable} ${geistMono.variable} antialiased`}
      >
        <Providers> 
        {children}
        </Providers>
      </body>
    </html>
  );
```

{% endtab %}

{% tab title="page.tsx" %}

```typescript
import { JustWeb3Button } from "@justweb3/widget";
import { ConnectButton } from "@rainbow-me/rainbowkit";


export default function Home() {
  return (
    <div>
      <JustWeb3Button>
        <ConnectButton/>
      </JustWeb3Button>
    </div>
  );
}
```

{% endtab %}
{% endtabs %}

#### React

{% tabs %}
{% tab title="App.tsx" %}

```typescript
import "@rainbow-me/rainbowkit/styles.css";
import '@justweb3/widget/styles.css';
import React from "react";
import {
  getDefaultConfig,
  getDefaultWallets,
  RainbowKitProvider,
} from "@rainbow-me/rainbowkit";
import {
  argentWallet,
  ledgerWallet,
  trustWallet,
} from "@rainbow-me/rainbowkit/wallets";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { WagmiProvider } from "wagmi";
import { mainnet, sepolia } from "wagmi/chains";
import {
  JustWeb3Provider,
  JustWeb3ProviderConfig,
  JustWeb3Button,
} from "@justweb3/widget";
import { ConnectButton } from "@rainbow-me/rainbowkit";

export const App: React.FC = () => {
  const { wallets } = getDefaultWallets();

  const config = getDefaultConfig({
    appName: "RainbowKit demo",
    projectId: "YOUR_PROJECT_ID",
    wallets: [
      ...wallets,
      {
        groupName: "Other",
        wallets: [argentWallet, trustWallet, ledgerWallet],
      },
    ],
    chains: [mainnet, sepolia],
    ssr: true,
  });

  const justweb3Config: JustWeb3ProviderConfig = {
    config: {
      origin: "http://localhost:3000/",
      domain: "localhost",
      signInTtl: 86400000,
    },
    openOnWalletConnect: true,
    allowedEns: "all",
    logo: "",
    ensDomains: [
      {
        ensDomain: "YOUR ENS DOMAIN",
        apiKey: "JUSTANAME API KEY",
        chainId: 1,
      },
    ],
    color: {
      primary: "hsl(216, 90%, 58%)",
      background: "hsl(0, 0%, 100%)",
      destructive: "hsl(0, 100%, 50%)",
    },
  };

  const queryClient = new QueryClient();

  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <RainbowKitProvider>
          <JustWeb3Provider config={justweb3Config}>
            <JustWeb3Button>
              <ConnectButton />
            </JustWeb3Button>
          </JustWeb3Provider>
        </RainbowKitProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
};

```

{% endtab %}
{% endtabs %}

To install the required dependencies, run the following command in your terminal:

{% tabs %}
{% tab title="npm" %}

```bash
npm install wagmi @rainbow-me/rainbowkit @tanstack/react-query
```

{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm install wagmi @rainbow-me/rainbowkit @tanstack/react-query
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add wagmi @rainbow-me/rainbowkit @tanstack/react-query
```

{% endtab %}
{% endtabs %}

### 5. You're all set!  🎉

You can find more information on how to customize your widget in the configuration section

{% content-ref url="/pages/RxyyyIPeROyPcHZXgDpi" %}
[Plug n Play (Widget)](/plug-n-play-widget/overview)
{% endcontent-ref %}


# Appearance

The JustWeb3 Widget offers flexible appearance customization, allowing you to style it to match your dApp's branding. You can modify colors, logos, and the general look and feel of the widget with ease. Below is a detailed guide on how to configure the appearance of your widget.

## Primary Color

The `primary` color controls the main accent color used throughout the widget for buttons, links, and other interactive elements. You can specify any valid CSS color format (hex, rgb, hsl, etc.).<br>

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  color: {
    primary: 'hsl(216, 90%, 58%)', // Example: Sky Blue
  },
};
```

## Background Color

The `background` color controls the background color of the widget. This is especially useful to make the widget fit seamlessly into your app’s design.

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  color: {
    background: 'hsl(0, 0%, 100%)', // Example: White
  },
};
```

## Destructive Color

The `destructive` color is used for warning or destructive actions (e.g., delete, reset). You can customize this to match your branding guidelines.

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  color: {
    destructive: 'hsl(0, 100%, 50%)', // Example: Red
  },
};

```

## Custom Logo

You can provide a custom logo to display in the widget interface. This logo helps reinforce your branding within the JustWeb3 Widget.

* Add the URL to your logo image in the `logo` field of the configuration.

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  logo: 'https://yourdomain.com/your-logo.png',
};

```

Ensure the logo has appropriate dimensions for best results. We recommend a **200x200px PNG or SVG**.

## Custom Fonts (Advanced)

While the widget doesn't directly expose a font customization option, you can apply custom fonts through global CSS in your app. To do this, apply the font styles in your project and ensure that your widget is contained within those styled elements.

```css
/* In your global CSS file */
body {
  --justweb3-font-family: 'YourCustomFont', sans-serif;
}
```

## Full Example Configuration

Below is an example configuration showcasing appearance customization with colors and a custom logo:

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000,
  },
  openOnWalletConnect: true,
  allowedEns: "all",
  logo: "https://yourdomain.com/your-logo.png",
  ensDomains: [
    {
      ensDomain: "your ens domain",
      apiKey: "YOUR_JUSTANAME_API_KEY",
      chainId: 1,
    }
  ],
  color: {
    primary: 'hsl(216, 90%, 58%)',   // Sky Blue
    background: 'hsl(0, 0%, 100%)',  // White
    destructive: 'hsl(0, 100%, 50%)' // Red
  }
};
```

This setup ensures the widget integrates smoothly with your dApp's design while maintaining a consistent brand experience.


# Allowed ENS Names

The JustWeb3 Widget allows you to control which ENS names or subnames users can use to sign in. You can either allow **all ENS names**, **restrict sign-ins to subnames derived from specific ENS domains**, or **restrict sign-ins to specific ENS domains and their subnames**.

## Default Settings: Allow All ENS Names

By default, the JustWeb3 Widget is configured to allow users to sign in with any ENS name. This setting is controlled by the `"allowedEns": "all"` configuration.

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000
  },
  allowedEns: "all", // Allows all ENS names for sign-in (default setting)
  ensDomains: [
    {
      ensDomain: "your ens domain",
      apiKey: "YOUR_API_KEY",
      chainId: 1
    }
  ],
  ...
};
```

In this configuration, users can sign in using any ENS name they own, regardless of the ens domain set.

## Restrict Sign-In to Subnames from the set ENS Domain

If you want to restrict sign-ins to subnames that are derived from a specific ENS domain, you can set `"allowedEns": "claimable"`. This will allow only subnames from the set `ensDomain` in your configuration.

For example, if you want to restrict sign-ins to subnames under the `justaname.eth` domain, you can configure it like this:

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000
  },
  allowedEns: "claimable", // Allows only subnames derived from the specified ENS domain
  ensDomains: [
    {
      ensDomain: "justaname.eth",
      apiKey: "YOUR_API_KEY",
      chainId: 1
    }
  ],
  ...
};
```

With this setting, only users who own subnames under the `justaname.eth` domain will be able to sign in.

## Restrict Sign-In to Specific ENS Domains and Their Subnames

A third option is to restrict sign-ins to specific ENS domains and their subnames. You can do this by specifying an array of ENS domains under the `"allowedEns"` configuration. This option allows users to sign in if they hold an ENS name or subname under one of the specified domains.

For example, if you want to allow sign-ins from `hello.eth`, `test.eth`, and their subnames, you would configure it like this:

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  allowedEns: ["hello.eth", "test.eth"], // Restrict to specific ENS domains and their subnames
  ensDomains: [
    {
      ensDomain: "justaname.eth",
      apiKey: "YOUR_API_KEY",
      chainId: 1
    }
  ],
  ...
};

```

In this configuration, users can sign in if they hold an ENS name or subname under `hello.eth`, `test.eth`, or the set ensDomain `justaname.eth`


# ENS Domains

In the JustWeb3 Widget configuration, you can specify which ENS domains will be used for your platform. By default, if no ENS domain is passed in the configuration, the following domains are used:

* **Mainnet**: `justan.id`
* **Testnet (Sepolia)**: `justan.eth`

However, if you have your own ENS domain and want to use it, you can configure it by adding the domain and the corresponding **API key**. This allows your platform to issue and manage subnames under the specified ENS domain.

**Example Configuration:**

{% hint style="info" %}
For security reasons and to follow best practices, it's important to avoid exposing your **API key** directly in the frontend configuration. Always refer to the [Backend Configuration ](broken://pages/nvPN32lXOjH9c9eqKkX7)section for guidance on securely managing API keys and handling sensitive operations.
{% endhint %}

```tsx
const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000,
  },
  openOnWalletConnect: true,
  allowedEns: "all",
  logo: "",
  ensDomains: [
    {
      ensDomain: "YOUR ENS DOMAIN",  // Replace with your custom ENS domain
      apiKey: "YOUR JUSTANAME API KEY",  // API key for JustaName
      chainId: 1,  // Ethereum mainnet chain ID
    },
  ],
  color: {
    primary: "hsl(216, 90%, 58%)",
    background: "hsl(0, 0%, 100%)",
    destructive: "hsl(0, 100%, 50%)",
  },
};
```

This configuration allows you to manage subnames under your custom ENS domain and ensures your platform's users can claim and use subnames within that domain.


# JustVerified

JustWeb3 Widget supports social verification through the **JustVerified Plugin**. This allows your users to verify their social identities (such as GitHub, Discord, Twitter, and others) in a decentralized and secure manner, adding a layer of trust and authentication to your dApp.

## Enabling JustVerified Plugin

To enable the **JustVerified Plugin**, include it within the `plugins` array in your JustWeb3 configuration. You can specify which social platforms you want your users to verify through. Currently, the following platforms are supported:

* **Twitter** (`'twitter'`)
* **Telegram** (`'telegram'`)
* **GitHub** (`'github'`)
* **Discord** (`'discord'`)
* **Email** (`'email'`)

You can choose any combination of these platforms based on your needs. For example, to enable verification for Twitter, GitHub, and Telegram:

```typescript
plugins: [
  JustVerifiedPlugin(['twitter', 'github', 'telegram'])
]
```

## Example Configuration with Github and Discord

In this example, we’ll show how to configure JustVerified with both **GitHub** and **Discord** as the required social platforms for verification.

```tsx
import { 
  JustVerifiedPlugin 
} from '@justverified/plugin';

const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000
  },
  openOnWalletConnect: true,
  allowedEns: "all",
  logo: "",
  ensDomains: [
    {
      ensDomain: "your ens domain",
      apiKey: "YOUR_API_KEY",
      chainId: 1
    }
  ],
  plugins: [
    JustVerifiedPlugin(['github', 'discord']) // Enabling GitHub and Discord verification
  ],
  color: {
    primary: "#FEA801",
    background: "hsl(0, 0%, 100%)",
    destructive: "hsl(0, 100%, 50%)"
  }
};

```

This will enforce verification for the specified platforms, ensuring your users are authenticated with their social identities before accessing certain features or services in your dApp.


# Networks

The JustWeb3 Widget allows you to customize the blockchain networks that users can connect to by specifying the **chainId** and a **providerUrl**. Currently, the widget supports **mainnet** (Ethereum Mainnet) and **sepolia** (Ethereum Testnet). You can configure either one or both networks.

If no network is specified, the widget will use default public RPC URLs for both networks.

## Specifying Custom Network Options

To specify a custom network provider, you need to pass the `networks` array in the widget configuration. Each network should be defined with its **chainId** and a corresponding **providerUrl**.

* **Mainnet** has a chainId of `1`.
* **Sepolia** has a chainId of `11155111`.

Here’s an example where both **mainnet** and **sepolia** are specified with custom provider URLs:

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000
  },
  networks: [
    { chainId: 1, providerUrl: "YOUR_MAINNET_PROVIDER_URL" },   // Custom Mainnet provider
    { chainId: 11155111, providerUrl: "YOUR_SEPOLIA_PROVIDER_URL" }  // Custom Sepolia provider
  ],
  ...
};

```

## Using Default Network Providers

If you don't specify a network in the configuration, the JustWeb3 Widget will default to public RPC URLs for both **mainnet** and **sepolia**. This allows your dApp to function out-of-the-box without requiring a custom provider but might be impacted by the limitations of publoc rpc endpoints.

```typescript
const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000
  },
  // No networks specified, so the widget will default to public RPC URLs
  ...
};

```


# Overview

After issuing subnames under your configured ENS domain, the [Admin Dashboard](https://dashboard.justaname.id/) becomes your central hub for managing, viewing, and analyzing user data\
\
In this section, you'll learn how to:

**View Subname Data**: Explore the different views available in the [Admin Dashboard](https://dashboard.justaname.id/) to monitor key data points such as subnames, attached addresses, claim dates, social handles, verification statuses, and resolution counts. Customize the dashboard view to show the data most relevant to your platform’s needs.

{% content-ref url="/pages/xsXg9v7KktpUhQBfTYF3" %}
[Views](/learn-and-engage/views)
{% endcontent-ref %}

**Filter Subname Data**: Utilize powerful filters to refine your view based on specific criteria such as social accounts, verification statuses, claim dates, and resolution activity. These filters allow you to target specific groups of users and extract meaningful insights that help in making data-driven decisions.

{% content-ref url="/pages/AWy5BgfZyoUFg1wlP76I" %}
[Filters](/learn-and-engage/filters)
{% endcontent-ref %}

By understanding how to navigate and leverage these tools, you can engage with your user base more effectively, track important metrics, and optimize your platform's growth and user experience.


# Views

The Admin Dashboard provides a clear and detailed view of all subnames issued under your ENS domain, offering key information such as addresses, claim dates, resolution counts, social handles, and verifications.

<figure><img src="/files/ylVY6zMICOK1IbrBHMzk" alt=""><figcaption></figcaption></figure>

## Viewing Subname Data on the Dashboard

When an admin navigates to the **Admin Dashboard**, they will have access to a comprehensive view of all subnames issued under the ENS domains they've configured. This default view provides key insights about each subname and its associated metadata.

**Key Data Points in the Default View:**

* **Subname**: The ENS subname that has been claimed (e.g., `user.justan.id`).
* **Address**: The blockchain address linked to the subname.
* **Claim Date**: The date when the subname was claimed.
* **Resolution Count**: The number of times the subname has been resolved (i.e., looked up or used on any platform).
* **Social Handles**: The social media accounts (Twitter, GitHub, etc.) that the user has linked to their subname.
* **Verifications**: The completed verifications attached to the subname, that the user has performed through **JustVerified** or other verification mechanisms.<br>

  <figure><img src="/files/ptiKbdBPMypadadDVjZg" alt=""><figcaption></figcaption></figure>

This default view is designed to give admins a quick and comprehensive overview of the key data points for each subname under their ENS domain, providing valuable information at a glance.

## Customizing the View

Admins have full control over how they view and organize this data. They can customize the dashboard view by choosing which data points are displayed for each subname. This means you can toggle on or off different columns based on what information is most relevant to your needs.

For example, you can choose to:

* Display only the **Subname**, **Address**, and **Claim Date** to focus on basic user data.
* Include **Social Handles** and **Verifications** to monitor user engagement and trust levels within your platform.
* Add **Resolution Count** to track how often certain subnames are being searched or used across platforms.

This flexibility ensures that the dashboard can be tailored to suit different admin goals, whether that’s monitoring user activity, analyzing social verifications, or tracking subname popularity.

## Reserving Subnames for Specific Addresses

In addition to viewing the issued subnames, admins can also **reserve specific subnames** for predetermined addresses. This is especially useful if certain high-value or branded subnames need to be protected or pre-allocated to specific users or partners. This feature ensures that these reserved subnames are blocked from general registration and are only assignable to the designated addresses.


# Filters

The [Admin Dashboard ](https://dashboard.justaname.id/)offers powerful filtering options to help you manage and analyze your user data more effectively. These filters allow you to refine your view of the subnames associated with your ENS domain, making it easier to find specific subnames or groups of users based on various criteria. By using these filters, admins can extract meaningful insights, target specific user groups, and monitor engagement trends within their platform.

## Available Filters

Admins have access to several filters that can be applied to the subname data, enabling them to narrow down results based on social handles, verifications, claim dates, and resolution activity. Below are the primary filters available on the dashboard:

### 1. Filtering by Attached Social Accounts

This filter allows admins to find subnames based on the social media accounts that users have attached to their subname metadata. For example, if you want to see all subnames where users have linked their Twitter account, you can use this filter.

**Example Use Case**:

* If you're interested in engaging with users who have connected their **Twitter** account, you can filter the list to display only subnames with a Twitter handle attached. This helps in identifying which users are active on certain platforms, enabling you to run targeted campaigns or promotions based on their social activity.

**Supported Social Platforms**:

* Twitter
* GitHub
* Discord
* Telegram
* Email

### 2. Filtering by Verifications

Admins can filter users based on the verifications they have completed, such as GitHub, Twitter, or Proof of Passport (PoP). This is especially useful for assessing the trust and credibility of users who have gone through specific verification steps.

**Example Use Case**:

* If you want to view all users who have verified their **GitHub account** and also hold a **Proof of Passport**, you can apply this filter. This helps in identifying high-trust users who have completed multiple verification processes, which may be relevant to perform an airdrop free of sybil actors

**Supported Verifications**:

* Twitter Verification
* Github Verification
* Telegram Verification
* Discord Verification
* Email Verification
* Proof-of-Passport

### 3. Filtering by Claim Dates

This filter allows admins to specify a date range and see which subnames were created during that time period. Two dates are provided—**start date** and **end date**—to refine the results to subnames claimed between these two points.

**Example Use Case:**

* If you want to see all subnames that were claimed between **January 1, 2024**, and **March 31, 2024**, you can set these as the start and end dates. This allows you to monitor user growth and track how subname issuance changes over time, especially useful for understanding when your platform experienced the most activity.

### 4. Filtering by Resolution Dates

The resolution filter lets admins find subnames based on how frequently and recently they have been resolved (i.e., searched or used) across platforms. This can help you track user engagement and see which subnames are actively being used.

**Example Use Case:**

* If you want to see subnames that have been resolved (looked up) within a specific date range, you can filter by resolution dates. This provides insights into which users are actively interacting with their subnames or being searched for by others, indicating higher levels of engagement with those specific subnames.

## Applying Multiple Filters

One of the strengths of the filtering mechanism is the ability to apply multiple filters simultaneously. This allows for a more granular view of the data. For example, you could filter by:

* Subnames with a **Twitter account** attached
* That have verified their **GitHub account**
* And were claimed between **two specific dates**

This layered approach ensures that admins can zero in on very specific groups of users, enabling more targeted engagement, communication, or analysis.


# JustaName Deployment Addresses

The **JustaName Resolver** is a crucial component of the platform that helps resolve ENS names to their associated metadata and addresses. Below are the deployment addresses for the JustaName Resolver on the supported Ethereum networks:

* **Mainnet**:\
  [`0x48De002d3c64e4cFD130A87A35ECD960c01954bc`](https://etherscan.io/address/0x48De002d3c64e4cFD130A87A35ECD960c01954bc)
* **Sepolia Testnet**:\
  [`0xAe9dF98d6ba6A0c91f99C941ab5aB820FDe95c30`](https://sepolia.etherscan.io/address/0xAe9dF98d6ba6A0c91f99C941ab5aB820FDe95c30)


# Coin Types

This section provides a comprehensive explanation on how to understand and use coin types, particularly within EVM (Ethereum Virtual Machine) compatible chains. We will reference formal specifications such as [**SLIP-0044**](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) for non-EVM coins and **ENSIP-11** for EVM compatible chains.

## Introduction to Coin Types

Coin types are identifiers used to uniquely specify the address encoding types of various cryptocurrencies, particularly in the context of deterministic wallets. These identifiers ensure that addresses for different types of coins are distinct and non-colliding.

## Coin Types for Non-EVM Chains

For non-EVM compatible chains, coin types are assigned according to the [SLIP-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) standard. This document lists various coin types and their respective cryptocurrencies.

## Coin Types for EVM-Compatible Chains

For EVM compatible chains, the **ENSIP-11** specification extends the basic multi-coin resolution principles introduced in **ENSIP-9**. ENSIP-11 provides a systematic way to derive and manage coin types for EVM chains.

### Abstract

ENSIP-11 dedicates a designated range for coin types for EVM chains, ensuring they do not collide with non-EVM coin types.

### Motivation

The primary motivation of ENSIP-11 is to avoid redundant requests for adding EVM compatible chains into SLIP 44 because most of these chains inherit Ethereum's address encoding type.

### Specification

* **MSB Reserved:** The most-significant bit (MSB) is reserved for EVM chain IDs.
* **Coin Type Derivation:** Compute the coin type for EVM chains by bitwise-ORing the chain ID with `0x80000000`:

```typescript
export const evmChainIdToCoinType = (chainId: number) => { 
  return (0x80000000 | chainId) >>> 0; 
}
```

**Reverse Operation:** To infer the chain ID from a coin type, bitwise-AND the coin type with `0x7fffffff`:

```typescript
export const coinTypeToEvmChainId = (coinType: number) => { 
  return (0x7fffffff & coinType) >> 0; 
}
```

### Implementation

An implementation is provided in the [ensdomains/address-encoder repository](https://github.com/ensdomains/address-encoder).

### Example

To compute the new coin type for an EVM chain (e.g., chain ID 61):

```typescript
import { coinTypeToEvmChainId, evmChainIdToCoinType } from "@ensdomains/address-encoder/utils";

console.log(evmChainIdToCoinType(61)); // Outputs: 2147483709
console.log(coinTypeToEvmChainId(2147483709)); // Outputs: 61
```

### Exceptions

Some EVM chains have specific considerations:

* **AVAX:** AVAX has multiple chain address formats, only `c` chain is EVM compatible.
* **RSK:** RSK requires additional validation.

These chains will continue using coin types as defined in SLIP44.

### Backward Compatibility

The following EVM compatible coin types were defined before this new standard and should be appended with `_LEGACY` for backward compatibility:

* NRG
* POA
* TT
* CELO
* CLO
* TOMO
* EWT
* THETA
* GO
* FTM
* XDAI
* ETC

When these are displayed, append `_LEGACY` to the coin type and mark them as read-only.


# JustaName - Under the Hood

The principal objective of JustaName is to enable users to write data without needing to execute a transaction on the blockchain.

This is achieved by storing the ENS data offchain. Therefore, while the data necessary to resolve a name to an address or retrieve the metadata attached to an address remains available, these operations can be performed without incurring the gas fees associated with on-chain transactions. This makes JustaName a cost-effective solution for working with ENS data.

JustaName offers the unique advantage of leveraging [CCIP-Read](https://eips.ethereum.org/EIPS/eip-3668) technology.

## Leveraging ERC-3668: CCIP-Read

CCIP-Read enables secure reading of offchain data, providing users with a way to access information residing offchain without compromising on the security standards that blockchain environments are recognized for.

By leveraging the capabilities of CCIP-Read, JustaName ensures that data can be manipulated offchain, while still maintaining trust in the data’s validity and integrity. This is crucial, ensuring that while the data is stored offchain, it remains verifiable and can't be altered or manipulated without detection.

## Resolving a Name with JustaName: A Detailed CCIP-Read Flow

ERC-3668 is at the heart of JustaName’s operation. The steps are meticulous and intricate consisting of fail signaling of the contract, subsequent communication with the Gateway, and callback to the contract. Below we present a detailed breakdown of the steps using the CCIP-Read technique within JustaName.

1. **Querying the Contract** As the request to resolve a name is initiated, it is received by the ENS Registry contract. If the resolver for the requested name points to the JustaName resolver, the name resolution request is directed accordingly. The JustaName Resolver contract, requiring off-chain data, intentionally fails with an **`OffchainLookup`** error. This error message carries vital information – it contains the URL of the gateway, which is the access point to JustaName's offchain storage, and **`extraData`** that is utilized in subsequent steps.
2. **Querying the Gateway** After the **`OffchainLookup`** error, the client retrieves the URL from the error message and makes a call to the gateway. This gateway call is made with the **`callData`** extracted from the **`OffchainLookup`** error message. The gateway is linked with the offchain storage and responds to this call request by providing the requisite data, however, its content, designed to maintain security, is opaque to the client.
3. **Making Transaction to Contract** With the data fetched from the gateway, the client now makes a call back to the original contract i.e., the JustaName Resolver. The client provides the response data received from the gateway along with the **`extraData`** from Step 1. The contract subsequently validates the received data against its offchain counterpart, validating the legitimacy and reliability of the data.

It's essential to note, the JustaName Resolver contract interface is structured to adhere to the CCIP-read protocol specifics. Alongside the failure error method of **`OffchainLookup`**, it also carries a callback function to decode the data returned by the gateway and validate the data's authenticity.

If the sequence of steps – calls and callbacks – are successfully executed, the data from Step 3's call will be relayed to the client as if it was returned by the originally called function. This entire process, though complex, is designed to be seamless and invisible to the client, allowing them to efficiently and securely resolve a name with JustaName, without even knowing they're accessing offchain data.


# Allowed Domains

Allowed Domains let you restrict which domains can use your API key, adding an extra layer of security when integrating JustaName SDKs directly in frontend applications.

### Setting Up Allowed Domains

1. Navigate to the **API Keys** section in your dashboard
2. Locate the API key you want to configure
3. Click the **three dots menu** (⋮) next to the key
4. Select **Add Domain** and enter your domain

### Wildcard Support

You can use wildcard patterns to allow multiple subdomains at once. For example:

* `*.justaname.id` — Allows all subdomains of justaname.id (e.g., `app.justaname.id`, `dev.justaname.id`, `staging.justaname.id`)
* `*.example.com` — Allows all subdomains of example.com

### When to Use Allowed Domains

**Recommended:** Configure allowed domains whenever you're using JustaName SDKs directly in frontend applications. Since frontend code is publicly accessible, restricting your API key to specific domains prevents unauthorized usage from other origins.


# Dynamic Records Resolution

### Overview

Previously, retrieving records attached to an ENS name stored offchain required querying gateways via API calls (when supported). JustaName now introduces a breakthrough solution that enables fully onchain dynamic record resolution.

### The Solution: \`records()\` function

JustaName now supports a new function `records() returns (string[])` that returns an array of all record types attached to an ENS name. This enables clients to discover available records dynamically and perform targeted onchain resolution.

#### Example Response Format

```javascript
[
  'addr(60)',
  'addr(246)', 
  'addr(820)',
  'addr(2147483704)',
  'addr(2147492101)',
  'text(com.github_justverified.eth)',
  'text(avatar)',
  'text(header)',
  'text(test)',
  'text(com.twitter_justverified.eth)',
  'text(display)',
  'text(org.telegram_justverified.eth)',
  'text(com.discord_justverified.eth)',
  'text(email_justverified.eth)',
  'text(Age)',
]
```

#### Benefits

**Dynamic Resolution**: Instead of guessing which records exist, clients can query the available record keys and resolve only what's actually present.

**Onchain Operations**: All operations are performed onchain, eliminating dependency on external gateways and API availability.

**Efficiency**: Reduces unnecessary calls by only resolving existing records.

### Implementation Example

The following code demonstrates how to implement dynamic ENS record resolution:

```javascript
import { http, createPublicClient } from "viem";
import { sepolia } from "viem/chains";
import {
  encodeFunctionData,
  decodeAbiParameters,
  parseAbi,
  parseAbiParameters,
} from "viem";
import { createEnsPublicClient } from "@ensdomains/ensjs";
import { getRecords } from "@ensdomains/ensjs/public";

const rpc = "https://sepolia.drpc.org";

const ensClient = createEnsPublicClient({
  chain: sepolia,
  transport: http(rpc),
});

const publicClient = createPublicClient({
  chain: sepolia,
  transport: http(rpc),
});

const resolveAbi = parseAbi([
  "function resolve(bytes,bytes) view returns (bytes)",
]);
const recordsAbi = parseAbi(["function records() view returns (string[])"]);

function encodeName(name) {
  const labels = name.split(".");
  let result = "0x";

  for (const label of labels) {
    if (label.length > 0) {
      const labelBytes = Buffer.from(label).toString("hex");
      result += label.length.toString(16).padStart(2, "0") + labelBytes;
    }
  }

  result += "00";
  return result;
}

const getRecordsKeys = async (name) => {
  const resolverAddress = await ensClient.getResolver({
    name,
  });

  const request = encodeFunctionData({
    abi: recordsAbi,
    functionName: "records",
    args: [],
  });

  const response = await publicClient.readContract({
    address: resolverAddress,
    abi: resolveAbi,
    functionName: "resolve",
    args: [encodeName(name), request],
  });

  const recordsParams = parseAbiParameters(["string[]"]);
  const records = decodeAbiParameters(recordsParams, response)[0];

  return records;
};

const resolveRecords = async (name) => {
  const recordKeys = await getRecordsKeys(name);
  console.log("Available record keys:", recordKeys);

  const textRecords = [];
  const coinRecords = [];

  recordKeys.forEach((key) => {
    if (key.startsWith("text(")) {
      const textKey = key.slice(5, -1);
      textRecords.push(textKey);
    } else if (key.startsWith("addr(")) {
      const coinType = key.slice(5, -1);
      coinRecords.push(coinType);
    }
  });

  console.log("Text records to fetch:", textRecords);
  console.log("Coin records to fetch:", coinRecords);

  const result = await getRecords(ensClient, {
    name: name,
    texts: textRecords,
    coins: coinRecords,
    contentHash: true,
  });

  return result;
};
```

#### Usage

* **Get Available Records**: Call `getRecordsKeys(name)` to retrieve all available record types for an ENS name
* **Parse Record Types**: The function categorizes records into text records and coin/address records
* **Dynamic Resolution**: Use the discovered record keys to perform targeted resolution with `getRecords()`


# Logos

List of JustaName Logos in various file formats.<br>

|         Format        |                                 SVG                                 |                PNG               |
| :-------------------: | :-----------------------------------------------------------------: | :------------------------------: |
|       JustaName       |      <p><img src="/files/VHCd5NeDgbDV2T6gePch" alt=""><br></p>      | ![](/files/wvDs2pQg0dCtFg51StrX) |
| JustaName (dark mode) |                   ![](/files/1mnHJBKiwUH07DKQ2Ixl)                  | ![](/files/y4lhQ0Odr60dfKDMVgdU) |
|      JustSomeone      | <img src="/files/7wYEun0cmwuNHj5n8v99" alt="" data-size="original"> | ![](/files/HHcpWpsF6PHZzqobErJz) |


# Overview

JustaName simplifies the management of ENS domains and subnames, offering a set of APIs that facilitate operations such as:

* **Subname Management**: Reserve, accept, add, update, and revoke ENS subnames.
* **Authentication via SIWE**: Authenticate users using the Sign-In with Ethereum (SIWE) protocol.
* **Primary Name Management**: Manage primary ENS names associated with Ethereum addresses.
* **mApp Integration**: Extend functionalities through mApps (metadata Applications), allowing dynamic updates to ENS metadata by trusted third parties.

By leveraging the JustaName API, developers can seamlessly integrate ENS functionalities into their applications, enhancing user experiences with decentralized naming systems.

#### Key Features

* **Simplified ENS Interaction**: Manage ENS subnames without dealing directly with smart contracts.
* **Secure User Authentication**: Utilize SIWE for secure, decentralized authentication.
* **Flexible Integration**: Designed to be flexible and adaptable to various application needs.
* **mApp Support**: Benefit from trustworthy, real-time updates while keeping users in control of their data.
* **Multi-Network Support**: Operate on Ethereum Mainnet (chain ID 1) and Sepolia Testnet (chain ID 11155111).

#### Authentication

Authentication is handled via HTTP headers and, when necessary, signed messages to verify ownership of Ethereum addresses. Common headers used include:

* `x-api-key`: Your API key for authenticated requests (required for certain endpoints).
* `x-signature`: The signature of the message, used to verify ownership.
* `x-message`: The original message that was signed.
* `x-address`: The Ethereum address associated with the signature.

### API Categories

The JustaName API is divided into the following main categories:

#### 1. **SIWE (Sign-In with Ethereum)**

* **Authentication**: Request and verify challenge messages securely.

#### 2. Subname **Management**

* **Reservation**: Reserve subnames for users or applications.
* **Acceptance**: Finalize the claim of reserved subnames.
* **Creation**: Add new subnames under a specified ENS domain.
* **Updating**: Modify addresses, text records, or other data linked to a subname.
* **Revocation**: Remove subnames from active use.

#### 3. **Primary Name Management**

* **Retrieval**: Retrieve primary ENS names associated with Ethereum addresses.
* **Setting**: Set or update primary names for user identities.

#### 4. **mApp Integration**

Manage permissions and data for applications interacting with JustaName.

* **Add mApp Permission:** Grants a trusted third-party application permission to update specific metadata fields of a user's subname dynamically.
* **Append mApp Field** Allows an mApp to append or update data fields in a user's subname metadata.
* **Revoke mApp Permission** Revokes a third-party application's permission to interact with a user's subname metadata.

### Getting Started

To begin using the JustaName API:

1. **Obtain an API Key**: Register and obtain an API key from <https://dashboard.justaname.id>
2. **Explore the API**: Familiarize yourself with the API categories and endpoints.
3. **Integrate Endpoints**: Use the base URLs and appropriate headers to integrate the API into your application.

For detailed information on each API endpoint, including request and response examples, please refer to the specific sections in the documentation.


# API reference

Welcome to the JustaName API Reference, our centralized location for all things JustaName. Here you can find all the APIs needed to integrate with our services.


# Siwe

Authentication via SIWE: Authenticate users using the Sign-In with Ethereum (SIWE) protocol.

Authentication: Request and verify challenge messages securely


# Request challenge

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/siwe/request-challenge" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Verify message

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/siwe/verify-message" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Mapp


# Add permission

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/siwe/mapp/add-permission" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Append field

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/siwe/mapp/append-field" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Revoke permission

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/siwe/mapp/revoke-permission" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Subname

Subname Management: Reserve, accept, add, update, and revoke ENS subnames.

* **Reservation**: Reserve subnames for users or applications.
* **Acceptance**: Finalize the claim of reserved subnames.
* **Creation**: Add new subnames under a specified ENS domain.
* **Updating**: Modify addresses, text records, or other data linked to a subname.
* **Revocation**: Remove subnames from active use.


# Accept

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/accept" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Reserve

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/reserve" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Add

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/add" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Update

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/update" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Revoke

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/revoke" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Reject

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/reject" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Subname

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/subname" method="get" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Ens

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/ens" method="get" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Address

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/address" method="get" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Records

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/records" method="get" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Available

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/available" method="get" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Search

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/subname/search" method="get" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Primary name

Primary Name Management: Manage primary ENS names associated with Ethereum addresses.

* **Retrieval**: Retrieve primary ENS names associated with Ethereum addresses.
* **Setting**: Set or update primary names for user identities


# Address

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/primary-name/address" method="get" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# Set primary name

{% openapi src="/files/sWkWit22yO4183tWPvFg" path="/ens/v1/primary-name/set-primary-name" method="post" %}
[swagger.json](https://2818832296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvyoXIYjGGjTqA4R1wGF2%2Fuploads%2FJbqh3zmmtlp9kQbvC448%2Fswagger.json?alt=media)
{% endopenapi %}


# JustWeb3 Widget

**@justweb3/widget** • [**Docs**](broken://pages/IGHmS1PVOdfHBTy8qYPX)

***

## @justweb3/widget

The **@justweb3/widget** library offers a complete identity solution for dApps. In just a few minutes, you can start issuing ENS subnames, authenticating users with SIWENS, managing profiles securely, and preventing Sybil attacks through social verifications and Proof of Personhood. The widget also integrates seamlessly with the **Admin Dashboard** to provide analytics and community engagement tools.

For detailed documentation, visit the official [JustaName Documentation](https://docs.justaname.id/).

### Try it out today on [Demo](https://demo.justaname.id/).

***

### Table of Contents

* [Overview](#overview)
* [Installation](#installation)
* [Setup](#setup)
* [Configuration](#configuration)
* [Appearance Customization](#appearance-customization)
* [Network Configuration](#network-configuration)
* [Features](#features)
* [License](#license)

***

### Overview

The **JustWeb3 Widget** is designed to simplify identity management for dApps. It provides:

* **ENS Subname Issuance:** Issue branded subnames for your users.
* **SIWENS Authentication:** Secure user authentication via ENS domains.
* **Profile Management:** Allow users to update and manage their profiles.
* **Social Verifications & Proof of Personhood:** Prevent Sybil attacks with social and zero-knowledge proofs.
* **Plugins:** Extend the widget’s capabilities with custom plugins.
* **Admin Dashboard:** Monitor subname usage and engage with your community.

***

### Installation

Install the widget with your preferred package manager:

```bash
bash
Copy code
npm install @justweb3/widget

```

You will also need additional dependencies:

```bash
bash
Copy code
npm install wagmi @rainbow-me/rainbowkit @tanstack/react-query

```

***

### Setup

Below is a sample setup for **Next.js** or **Vite** projects. The widget works with **RainbowKit** or any other wallet provider like WalletConnect, Privy, or Web3Auth.

#### Example Integration

```tsx
'use client';

import "@rainbow-me/rainbowkit/styles.css";
import '@justweb3/widget/styles.css';
import {
  getDefaultConfig,
  getDefaultWallets,
  RainbowKitProvider,
} from "@rainbow-me/rainbowkit";
import { WagmiProvider } from "wagmi";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { JustWeb3Provider, JustWeb3Button } from "@justweb3/widget";
import { mainnet, sepolia } from "wagmi/chains";

const Providers = ({ children }) => {
  const { wallets } = getDefaultWallets();
  const config = getDefaultConfig({
    appName: "Your dApp",
    wallets,
    chains: [mainnet, sepolia],
  });

  const justweb3Config = {
    config: {
      origin: "http://localhost:3000/",
      domain: "localhost",
      signInTtl: 86400000,
    },
    openOnWalletConnect: true,
    allowedEns: "all",
    logo: "",
    ensDomains: [
      {
        ensDomain: "yourdomain.eth",
        apiKey: "YOUR_API_KEY",
        chainId: 1,
      },
    ],
  };

  const queryClient = new QueryClient();

  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <RainbowKitProvider>
          <JustWeb3Provider config={justweb3Config}>
            {children}
          </JustWeb3Provider>
        </RainbowKitProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
};

export default Providers;

```

***

### Configuration

#### API Key Setup

1. **Sign Up:** Create an account in the [Admin Dashboard](https://docs.justaname.id/).
2. **Configure ENS Domain:** Set up your domain, or purchase one if needed.
3. **Generate API Key:** Save your API key securely—it will not be retrievable later.

#### Widget Configuration

```tsx
const justweb3Config = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000,
  },
  openOnWalletConnect: true,
  allowedEns: "all",
  logo: "https://yourdomain.com/your-logo.png",
  ensDomains: [
    {
      chainId: 1,
      domain: 'your_ens_domain.eth',
      apiKey: 'your-api-key' // Not recommended for production, use a backend server to protect your API key
    }
  ],
  backendUrl: 'https://your-backend-url.com', // Leave empty for same origin (e.g when using Next.js)
  color: {
    primary: 'hsl(216, 90%, 58%)', // Sky Blue
    background: 'hsl(0, 0%, 100%)', // White
    destructive: 'hsl(0, 100%, 50%)', // Red
  },
};

```

***

### Appearance Customization

The widget supports easy appearance customization to fit your dApp's branding.

* **Primary Color:** Controls buttons, links, and accents.
* **Background Color:** Matches the widget’s background with your design.
* **Destructive Color:** Used for warnings or destructive actions.
* **Logo:** Add a custom logo to enhance branding.

```tsx
const justweb3Config = {
  color: {
    primary: 'hsl(216, 90%, 58%)',
    background: 'hsl(0, 0%, 100%)',
    destructive: 'hsl(0, 100%, 50%)',
  },
  logo: 'https://yourdomain.com/logo.png',
};

```

***

### Network Configuration

The widget supports **Ethereum Mainnet** and **Sepolia Testnet**. Use public RPCs or provide custom URLs.

```tsx
const justweb3Config = {
  networks: [
    { chainId: 1, providerUrl: "YOUR_MAINNET_PROVIDER_URL" },
    { chainId: 11155111, providerUrl: "YOUR_SEPOLIA_PROVIDER_URL" },
  ],
};

```

If no custom provider is specified, the widget defaults to public RPC URLs.

***

### Features

* **Complete ENS Management:** Claim, update, and authenticate ENS subnames.
* **JustEnsCard Component:** Displays detailed ENS data for any name.
* **SIWENS Authentication:** Secure, decentralized sign-in using ENS.
* **Extendable via Plugins:** Add new features with ease.
* **Admin Dashboard Integration:** Monitor user activity and subname management.
* **Flexible Wallet Integration:** Works with RainbowKit, WalletConnect, Privy, and more.

***

### License

This project is licensed under the MIT License. For more details, refer to the official [JustaName Documentation](https://docs.justaname.id/).


# globals

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

## @justweb3/widget

### Interfaces

* [JustaPlugin](/sdk-reference/readme/interfaces/justaplugin)
* [JustWeb3ContextProps](/sdk-reference/readme/interfaces/justweb3contextprops)
* [JustWeb3ProviderConfig](/sdk-reference/readme/interfaces/justweb3providerconfig)
* [JustWeb3ProviderProps](/sdk-reference/readme/interfaces/justweb3providerprops)
* [PluginApi](/sdk-reference/readme/interfaces/pluginapi)
* [useJustWeb3](/sdk-reference/readme/interfaces/usejustweb3)

### Type Aliases

* [UpdateRecordsParams](/sdk-reference/readme/type-aliases/updaterecordsparams)

### Variables

* [JustWeb3Context](/sdk-reference/readme/variables/justweb3context)

### Functions

* [EnsMetadataBadge](/sdk-reference/readme/functions/ensmetadatabadge)
* [getChainIcon](/sdk-reference/readme/functions/getchainicon)
* [getContentHashIcon](/sdk-reference/readme/functions/getcontenthashicon)
* [getTextRecordIcon](/sdk-reference/readme/functions/gettextrecordicon)
* [JustaNameDialog](/sdk-reference/readme/functions/justanamedialog)
* [JustaNameFooter](/sdk-reference/readme/functions/justanamefooter)
* [JustaNameLoadingDialog](/sdk-reference/readme/functions/justanameloadingdialog)
* [JustEnsCard](/sdk-reference/readme/functions/justenscard)
* [JustWeb3Button](/sdk-reference/readme/functions/justweb3button)
* [JustWeb3Provider](/sdk-reference/readme/functions/justweb3provider)
* [ProfileSection](/sdk-reference/readme/functions/profilesection)
* [useDebounce](/sdk-reference/readme/functions/usedebounce)
* [useJustWeb3](/sdk-reference/readme/functions/usejustweb3)
* [usePlugins](/sdk-reference/readme/functions/useplugins)


# functions


# EnsMetadataBadge

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / EnsMetadataBadge

## Function: EnsMetadataBadge()

> **EnsMetadataBadge**(`props`, `deprecatedLegacyContext`?): `ReactNode`

### Parameters

• **props**: `MetadataCardProps`

• **deprecatedLegacyContext?**: `any`

**Deprecated**

**See**

[React Docs](https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods)

### Returns

`ReactNode`

### Defined in

[packages/@justweb3/widget/src/lib/components/MetadataCard/index.tsx:15](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/components/MetadataCard/index.tsx#L15)


# JustEnsCard

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustEnsCard

## Function: JustEnsCard()

> **JustEnsCard**(`props`, `deprecatedLegacyContext`?): `ReactNode`

### Parameters

• **props**: `JustEnsCardProps`

• **deprecatedLegacyContext?**: `any`

**Deprecated**

**See**

[React Docs](https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods)

### Returns

`ReactNode`

### Defined in

[packages/@justweb3/widget/src/lib/components/JustEnsCard/index.tsx:17](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/components/JustEnsCard/index.tsx#L17)


# JustWeb3Button

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustWeb3Button

## Function: JustWeb3Button()

> **JustWeb3Button**(`props`, `deprecatedLegacyContext`?): `ReactNode`

### Parameters

• **props**: `JustWeb3Buttonrops`

• **deprecatedLegacyContext?**: `any`

**Deprecated**

**See**

[React Docs](https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods)

### Returns

`ReactNode`

### Defined in

[packages/@justweb3/widget/src/lib/components/JustWeb3Button/index.tsx:41](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/components/JustWeb3Button/index.tsx#L41)


# JustWeb3Provider

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustWeb3Provider

## Function: JustWeb3Provider()

> **JustWeb3Provider**(`props`, `deprecatedLegacyContext`?): `ReactNode`

### Parameters

• **props**: [`JustWeb3ProviderProps`](/sdk-reference/readme/interfaces/justweb3providerprops)

• **deprecatedLegacyContext?**: `any`

**Deprecated**

**See**

[React Docs](https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods)

### Returns

`ReactNode`

### Defined in

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:80](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L80)


# JustaNameDialog

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustaNameDialog

## Function: JustaNameDialog()

> **JustaNameDialog**(`props`, `deprecatedLegacyContext`?): `ReactNode`

### Parameters

• **props**: `DefaultDialogProps`

• **deprecatedLegacyContext?**: `any`

**Deprecated**

**See**

[React Docs](https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods)

### Returns

`ReactNode`

### Defined in

[packages/@justweb3/widget/src/lib/dialogs/DefaultDialog/index.tsx:27](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/dialogs/DefaultDialog/index.tsx#L27)


# JustaNameFooter

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustaNameFooter

## Function: JustaNameFooter()

> **JustaNameFooter**(): `Element`

### Returns

`Element`

### Defined in

[packages/@justweb3/widget/src/lib/components/JustaNameFooter/index.tsx:3](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/components/JustaNameFooter/index.tsx#L3)


# JustaNameLoadingDialog

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustaNameLoadingDialog

## Function: JustaNameLoadingDialog()

> **JustaNameLoadingDialog**(`props`, `deprecatedLegacyContext`?): `ReactNode`

### Parameters

• **props**: `LoadingDialogProps`

• **deprecatedLegacyContext?**: `any`

**Deprecated**

**See**

[React Docs](https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods)

### Returns

`ReactNode`

### Defined in

[packages/@justweb3/widget/src/lib/dialogs/LoadingDialog/index.tsx:10](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/dialogs/LoadingDialog/index.tsx#L10)


# ProfileSection

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / ProfileSection

## Function: ProfileSection()

> **ProfileSection**(`props`, `deprecatedLegacyContext`?): `ReactNode`

### Parameters

• **props**: `ProfileSectionProps`

• **deprecatedLegacyContext?**: `any`

**Deprecated**

**See**

[React Docs](https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods)

### Returns

`ReactNode`

### Defined in

[packages/@justweb3/widget/src/lib/components/Profile/ProfileSection/index.tsx:10](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/components/Profile/ProfileSection/index.tsx#L10)


# getChainIcon

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / getChainIcon

## Function: getChainIcon()

> **getChainIcon**(`chain`, `size`?): `Element`

### Parameters

• **chain**: `string`

• **size?**: `number`

### Returns

`Element`

### Defined in

[packages/@justweb3/widget/src/lib/icons/chain-icons/index.tsx:3](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/icons/chain-icons/index.tsx#L3)


# getContentHashIcon

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / getContentHashIcon

## Function: getContentHashIcon()

> **getContentHashIcon**(`contentHashProtocol`): `Element`

### Parameters

• **contentHashProtocol**: `string`

### Returns

`Element`

### Defined in

[packages/@justweb3/widget/src/lib/icons/contentHash-icons/index.tsx:11](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/icons/contentHash-icons/index.tsx#L11)


# getTextRecordIcon

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / getTextRecordIcon

## Function: getTextRecordIcon()

> **getTextRecordIcon**(`key`): `Element`

### Parameters

• **key**: `string`

### Returns

`Element`

### Defined in

[packages/@justweb3/widget/src/lib/icons/records-icons/index.tsx:17](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/icons/records-icons/index.tsx#L17)


# useDebounce

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / useDebounce

## Function: useDebounce()

> **useDebounce**<`T`>(`value`, `delay`): `object`

### Type Parameters

• **T**

### Parameters

• **value**: `T`

• **delay**: `number`

### Returns

`object`

#### debouncedValue

> **debouncedValue**: `T`

#### isDebouncing

> **isDebouncing**: `boolean`

### Defined in

[packages/@justweb3/widget/src/lib/hooks/useDebounce/index.tsx:3](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/hooks/useDebounce/index.tsx#L3)


# useJustWeb3

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / useJustWeb3

## Function: useJustWeb3()

> **useJustWeb3**(): [`useJustWeb3`](/sdk-reference/readme/interfaces/usejustweb3)

### Returns

[`useJustWeb3`](/sdk-reference/readme/interfaces/usejustweb3)

### Defined in

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:283](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L283)


# usePlugins

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / usePlugins

## Function: usePlugins()

> **usePlugins**(): `PluginContextProps`

### Returns

`PluginContextProps`

### Defined in

[packages/@justweb3/widget/src/lib/providers/PluginProvider/index.tsx:421](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/PluginProvider/index.tsx#L421)


# interfaces


# JustWeb3ContextProps

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustWeb3ContextProps

## Interface: JustWeb3ContextProps

### Properties

#### config

> **config**: [`JustWeb3ProviderConfig`](/sdk-reference/readme/interfaces/justweb3providerconfig)

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:64](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L64)

***

#### handleJustWeb3Config()

> **handleJustWeb3Config**: (`config`) => `void`

**Parameters**

• **config**: [`JustWeb3ProviderConfig`](/sdk-reference/readme/interfaces/justweb3providerconfig)

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:61](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L61)

***

#### handleOpenEnsProfile()

> **handleOpenEnsProfile**: (`ens`, `chainId`?) => `void`

**Parameters**

• **ens**: `string`

• **chainId?**: `ChainId`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:62](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L62)

***

#### handleOpenSignInDialog()

> **handleOpenSignInDialog**: (`open`) => `void`

**Parameters**

• **open**: `boolean`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:57](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L57)

***

#### handleUpdateRecords()

> **handleUpdateRecords**: (`records`) => `Promise`<`void`>

**Parameters**

• **records**: [`UpdateRecordsParams`](/sdk-reference/readme/type-aliases/updaterecordsparams) & `object`

**Returns**

`Promise`<`void`>

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:58](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L58)

***

#### isSignInOpen

> **isSignInOpen**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:63](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L63)

***

#### mApps

> **mApps**: `string`\[]

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:66](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L66)

***

#### plugins

> **plugins**: [`JustaPlugin`](/sdk-reference/readme/interfaces/justaplugin)\[]

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:65](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L65)


# JustWeb3ProviderConfig

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustWeb3ProviderConfig

## Interface: JustWeb3ProviderConfig

### Extends

* `JustaNameProviderConfig`.`JustWeb3ThemeProviderConfig`

### Properties

#### allowedEns?

> `optional` **allowedEns**: `"all"` | `string`\[] | `"claimable"`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:42](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L42)

***

#### backendUrl?

> `optional` **backendUrl**: `string`

**Inherited from**

`JustaNameProviderConfig.backendUrl`

**Defined in**

packages/@justaname.id/react/dist/src/lib/providers/JustaNameProvider.d.ts:21

***

#### color?

> `optional` **color**: `object`

**background?**

> `optional` **background**: `string`

**destructive?**

> `optional` **destructive**: `string`

**primary?**

> `optional` **primary**: `string`

**Inherited from**

`JustWeb3ThemeProviderConfig.color`

**Defined in**

packages/@justweb3/ui/dist/src/lib/providers/JustWeb3ThemeProvider/index.d.ts:35

***

#### config?

> `optional` **config**: `Configuration`

**Inherited from**

`JustaNameProviderConfig.config`

**Defined in**

packages/@justaname.id/sdk/dist/src/lib/types/justaname/configuration.d.ts:28

***

#### dev?

> `optional` **dev**: `boolean`

**Inherited from**

`JustaNameProviderConfig.dev`

**Defined in**

packages/@justaname.id/sdk/dist/src/lib/types/justaname/configuration.d.ts:32

***

#### disableOverlay?

> `optional` **disableOverlay**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:44](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L44)

***

#### ensDomains?

> `optional` **ensDomains**: `EnsDomains`

**Inherited from**

`JustaNameProviderConfig.ensDomains`

**Defined in**

packages/@justaname.id/sdk/dist/src/lib/types/justaname/configuration.d.ts:30

***

#### logo?

> `optional` **logo**: `string`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:43](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L43)

***

#### mApps?

> `optional` **mApps**: (`string` | `object`)\[]

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:45](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L45)

***

#### networks?

> `optional` **networks**: `Networks`

**Inherited from**

`JustaNameProviderConfig.networks`

**Defined in**

packages/@justaname.id/sdk/dist/src/lib/types/justaname/configuration.d.ts:29

***

#### openOnWalletConnect?

> `optional` **openOnWalletConnect**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:41](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L41)

***

#### plugins?

> `optional` **plugins**: [`JustaPlugin`](/sdk-reference/readme/interfaces/justaplugin)\[]

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:46](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L46)

***

#### routes?

> `optional` **routes**: `Partial`<`object`>

**Type declaration**

**addSubnameRoute**

> **addSubnameRoute**: `string`

**currentEnsRoute**

> **currentEnsRoute**: `string`

**revokeSubnameRoute**

> **revokeSubnameRoute**: `string`

**signinNonceRoute**

> **signinNonceRoute**: `string`

**signinRoute**

> **signinRoute**: `string`

**signoutRoute**

> **signoutRoute**: `string`

**Inherited from**

`JustaNameProviderConfig.routes`

**Defined in**

packages/@justaname.id/react/dist/src/lib/providers/JustaNameProvider.d.ts:20

***

#### signOnMounted?

> `optional` **signOnMounted**: `boolean`

**Inherited from**

`JustaNameProviderConfig.signOnMounted`

**Defined in**

packages/@justaname.id/react/dist/src/lib/providers/JustaNameProvider.d.ts:22


# JustWeb3ProviderProps

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustWeb3ProviderProps

## Interface: JustWeb3ProviderProps

### Properties

#### children

> **children**: `ReactNode`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:50](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L50)

***

#### config

> **config**: [`JustWeb3ProviderConfig`](/sdk-reference/readme/interfaces/justweb3providerconfig)

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:51](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L51)


# JustaPlugin

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustaPlugin

## Interface: JustaPlugin

### Properties

#### components?

> `optional` **components**: `PluginComponents`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:124](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L124)

***

#### hooks?

> `optional` **hooks**: `Hooks`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:128](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L128)

***

#### mApps?

> `optional` **mApps**: `string`\[]

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:126](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L126)

***

#### name

> **name**: `string`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:122](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L122)

***

#### priority?

> `optional` **priority**: `number`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:130](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L130)


# PluginApi

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / PluginApi

## Interface: PluginApi

### Properties

#### chainId

> **chainId**: `undefined` | `number`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:10](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L10)

***

#### connectedEns

> **connectedEns**: `undefined` | `null` | `object`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:7](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L7)

***

#### eventEmitter

> **eventEmitter**: `EventEmitter`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:16](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L16)

***

#### getState()

> **getState**: <`T`>(`key`) => `undefined` | `T`

**Type Parameters**

• **T**

**Parameters**

• **key**: `string`

**Returns**

`undefined` | `T`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:14](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L14)

***

#### handleOpenAuthorizeMAppDialog()

> **handleOpenAuthorizeMAppDialog**: (`mApp`, `open`) => `void`

**Parameters**

• **mApp**: `string`

• **open**: `boolean`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:18](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L18)

***

#### handleOpenRevokeMAppDialog()

> **handleOpenRevokeMAppDialog**: (`mApp`, `open`) => `void`

**Parameters**

• **mApp**: `string`

• **open**: `boolean`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:19](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L19)

***

#### handleOpenSignInDialog()

> **handleOpenSignInDialog**: (`open`) => `void`

**Parameters**

• **open**: `boolean`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:20](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L20)

***

#### isEnsAuthPending

> **isEnsAuthPending**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:8](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L8)

***

#### isLoggedIn

> **isLoggedIn**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:9](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L9)

***

#### mApps

> **mApps**: `string`\[]

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:12](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L12)

***

#### records

> **records**: `undefined` | `Records`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:11](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L11)

***

#### setState()

> **setState**: <`T`>(`key`, `value`) => `void`

**Type Parameters**

• **T**

**Parameters**

• **key**: `string`

• **value**: `T`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/plugins/index.ts:13](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/plugins/index.ts#L13)


# useJustWeb3

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / useJustWeb3

## Interface: useJustWeb3

### Properties

#### chainId

> **chainId**: `undefined` | `ChainId`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:280](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L280)

***

#### connectedEns

> **connectedEns**: `undefined` | `null` | `object`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:275](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L275)

***

#### handleOpenSignInDialog()

> **handleOpenSignInDialog**: (`open`) => `void`

**Parameters**

• **open**: `boolean`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:265](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L265)

***

#### isEnsAuthFetching

> **isEnsAuthFetching**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:273](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L273)

***

#### isEnsAuthLoading

> **isEnsAuthLoading**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:272](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L272)

***

#### isEnsAuthPending

> **isEnsAuthPending**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:271](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L271)

***

#### isLoggedIn

> **isLoggedIn**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:270](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L270)

***

#### isSignInOpen

> **isSignInOpen**: `boolean`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:266](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L266)

***

#### openEnsProfile()

> **openEnsProfile**: (`ens`, `chainId`?) => `void`

**Parameters**

• **ens**: `string`

• **chainId?**: `ChainId`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:276](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L276)

***

#### refreshEnsAuth()

> **refreshEnsAuth**: () => `void`

**Returns**

`void`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:274](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L274)

***

#### signIn

> **signIn**: `UseMutateAsyncFunction`<`string`, `Error`, `UseEnsSignInFunctionParams`, `unknown`>

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:267](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L267)

***

#### signOut()

> **signOut**: () => `Promise`<`void`>

**Returns**

`Promise`<`void`>

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:268](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L268)

***

#### status

> **status**: `"pending"` | `"signedIn"` | `"signedOut"`

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:269](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L269)

***

#### updateRecords()

> **updateRecords**: (`records`) => `Promise`<`void`>

**Parameters**

• **records**: `Omit`<`UseSubnameUpdateFunctionParams`, `"ens"`> & `object`

**Returns**

`Promise`<`void`>

**Defined in**

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:277](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L277)


# type-aliases


# UpdateRecordsParams

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / UpdateRecordsParams

## Type Alias: UpdateRecordsParams

> **UpdateRecordsParams**: `Omit`<`UseSubnameUpdateFunctionParams`, `"ens"`>

### Defined in

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:54](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L54)


# variables


# JustWeb3Context

[**@justweb3/widget**](/sdk-reference) • **Docs**

***

[@justweb3/widget](broken://pages/IGHmS1PVOdfHBTy8qYPX) / JustWeb3Context

## Variable: JustWeb3Context

> `const` **JustWeb3Context**: `Context`<[`JustWeb3ContextProps`](/sdk-reference/readme/interfaces/justweb3contextprops)>

### Defined in

[packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx:69](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justweb3/widget/src/lib/providers/JustWeb3Provider/index.tsx#L69)


# JustaName Core SDK

**@justaname.id/sdk** • [**Docs**](/sdk-reference/justaname-core-sdk/globals)

***

## JustaName SDK

JustaName SDK is a toolkit for managing Ethereum Name Service (ENS) domains and subnames. It simplifies the integration of ENS functionalities into any application, including resolving ENS names, issuing off-chain subnames, and enabling Sign-In with ENS (SIWENS). The SDK supports both Ethereum Mainnet and Testnet environments.

### Table of Contents

* [Motivation](#motivation)
* [Features](#features)
* [How It Works](#how-it-works)
* [Installation](#installation)
* [Quickstart Guide](#quickstart-guide)
  * [Initialization](#initialization)
  * [Issuing a Subname](#issuing-a-subname)
  * [Updating a Subname](#updating-a-subname)
  * [Signing In with ENS](#signing-in-with-ens)
* [Benefits](#benefits)
* [Available Methods](#available-methods)
  * [Subname Management](#subname-management)
  * [SIWE](#siwe)
  * [Sign-In with ENS](#sign-in-with-ens)
  * [Offchain Resolvers](#offchain-resolvers)
* [Contributing](#contributing)

### Motivation

Managing ENS domains and integrating them into applications can be complex and time-consuming. JustaName SDK aims to streamline this process by providing an easy-to-use interface for off-chain ENS management, subname issuance, and authentication using ENS domains. By abstracting the underlying complexities, developers can focus on building feature-rich applications without worrying about ENS integration details.

### Features

* **ENS Management:** Manage ENS domains and subnames off-chain effortlessly.
* **Subname Issuance:** Issue and update subnames without interacting directly with smart contracts.
* **ENS Resolution:** Resolve on-chain and off-chain ENS easily within your application.
* **Sign-In with ENS (SIWENS):** Authenticate users using their ENS domains for a decentralized and secure sign-in experience.
* **Mainnet and Testnet Support:** Compatible with Ethereum Mainnet and Testnet environments.
* **Easy Integration:** Simplifies the incorporation of ENS functionalities into any application.

### How It Works

JustaName SDK interacts with the JustaName API to perform off-chain operations related to ENS domains and subnames. It handles the necessary cryptographic operations, such as signing messages and verifying signatures, to ensure secure interactions. By using the SDK, developers can perform tasks like issuing subnames, updating records, and authenticating users without dealing with the complexities of the Ethereum blockchain directly.

### Installation

Install the package using npm or yarn:

```bash
npm install @justaname.id/sdk

# or

yarn add @justaname.id/sdk
```

### Quickstart Guide

#### Initialization

First, import the JustaName SDK and initialize it with your configuration:

```typescript
import { JustaName } from '@justaname.id/sdk';
import { ethers } from 'ethers';

// Initialize the SDK with your configuration
const justaname = JustaName.init({
    networks: [
        {
          chainId: 1, // Ethereum Mainnet
          providerUrl: 'https://mainnet.infura.io/v3/YOUR_INFURA_KEY'
        }
    ],
    ensDomains: [
        {
          chainId: 1,
          domain: 'your_ens_domain.eth',
          apiKey: 'your-api-key',
        }
            
    ],
    config: {
        domain: 'yourdapp.com',
        origin: 'https://yourdapp.com'
    }
});

// Create a signer (for example purposes, we're creating a random wallet)
const signer = ethers.Wallet.createRandom();
```

#### Issuing a Subname

To issue a subname off-chain, you can use the following code:

```typescript
async function issueSubname() {
    const challenge = await justaname.siwe.requestChallenge({
        address: signer.address,
        chainId: 1 // Ethereum Mainnet
    });
    
    const signature = await signer.signMessage(challenge.challenge);
    
    const response = await justaname.subnames.addSubname(
    {
        username: 'username1',
        chainId: 1
    },
    {
        xMessage: challenge.challenge,
        xAddress: signer.address,
        xSignature: signature
    });
    
    console.log('Subname issued successfully:', response);
    return response;
}
```

#### Updating a Subname

To update records associated with a subname, such as setting an avatar:

```typescript
async function updateSubname() {
    const challenge = await justaname.siwe.requestChallenge({
        address: signer.address,
        chainId: 1
    });
    
    const signature = await signer.signMessage(challenge.challenge);
    
    const response = await justaname.subnames.updateSubname(
    {
        username: 'username1',
        chainId: 1,
        text: [
            {
            key: 'avatar',
            value: 'https://youravatar.com/avatar.png'
            }
        ]
    },
    {
        xMessage: challenge.challenge,
        xAddress: signer.address,
        xSignature: signature
    });
    
    console.log('Subname updated successfully:', response);
    return response;
}
```

#### Signing In with ENS

Enable users to sign in to your application using their ENS domain:

```typescript
async function signIn() {
    const message = await justaname.signIn.requestSignIn({
        ens: 'your_ens_domain.eth',
        address: signer.address
    });
    
    const signature = await signer.signMessage(message);
    
    const response = await justaname.signIn.signIn({
        message: message,
        signature: signature
    });
    
    console.log('User signed in with ENS:', response.ens);
    return response;
}
```

#### Putting It All Together

You can combine these functions to manage subnames and authenticate users:

```typescript
async function main() {
    await issueSubname();
    await updateSubname();
    await signIn();
}

main().catch(console.error);
```

### Available Methods

#### Subname Management

* acceptSubname
* reserveSubname
* addSubname
* updateSubname
* revokeSubname
* rejectSubname
* getSubnamesByEnsDomainWithCount
* getSubname
* getSubnamesByAddress
* getInvitationsByAddress
* getSubnamesByEnsDomain
* searchSubnames
* isSubnameAvailable
* getRecords
* getPrimaryNameByAddress

#### SIWE

* requestChallenge
* verifyChallenge

#### Sign-In with ENS

* requestSignIn
* signIn
* generateNonce

#### Offchain Resolvers

* getAllOffchainResolvers

#### Benefits

Simplified ENS Integration: Abstracts the complexities of interacting with the Ethereum blockchain and ENS smart contracts.

Off-Chain Management: Perform ENS domain and subname operations off-chain, reducing gas costs and improving performance.

Enhanced Security: Utilizes cryptographic signatures to ensure secure operations.

User-Friendly Authentication: Allows users to sign in with their ENS domains, enhancing user experience and security.

Flexible Environment Support: Works seamlessly with both Ethereum Mainnet and Testnet networks.

#### Contributing

Contributions are welcome! If you have suggestions or find issues, please open an issue or submit a pull request on the GitHub repository.


# globals

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

## @justaname.id/sdk

### Classes

* [ApiKeyRequiredException](/sdk-reference/justaname-core-sdk/classes/apikeyrequiredexception)
* [InvalidConfigurationException](/sdk-reference/justaname-core-sdk/classes/invalidconfigurationexception)
* [InvalidENSException](/sdk-reference/justaname-core-sdk/classes/invalidensexception)
* [InvalidSignInException](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)
* [JustaName](/sdk-reference/justaname-core-sdk/classes/justaname)
* [OffchainResolvers](/sdk-reference/justaname-core-sdk/classes/offchainresolvers)
* [SignIn](/sdk-reference/justaname-core-sdk/classes/signin)
* [SubnameChallenge](/sdk-reference/justaname-core-sdk/classes/subnamechallenge)
* [Subnames](/sdk-reference/justaname-core-sdk/classes/subnames)

### Interfaces

* [Address](/sdk-reference/justaname-core-sdk/interfaces/address)
* [AddressWithTypedCoins](/sdk-reference/justaname-core-sdk/interfaces/addresswithtypedcoins)
* [ApiKeyHeaders](/sdk-reference/justaname-core-sdk/interfaces/apikeyheaders)
* [ApiKeyResponse](/sdk-reference/justaname-core-sdk/interfaces/apikeyresponse)
* [ApiKeyRoute](/sdk-reference/justaname-core-sdk/interfaces/apikeyroute)
* [BaseResponse](/sdk-reference/justaname-core-sdk/interfaces/baseresponse)
* [Coin](/sdk-reference/justaname-core-sdk/interfaces/coin)
* [CoinType](/sdk-reference/justaname-core-sdk/interfaces/cointype)
* [Configuration](/sdk-reference/justaname-core-sdk/interfaces/configuration)
* [ContentHash](/sdk-reference/justaname-core-sdk/interfaces/contenthash)
* [EmptyHeaders](/sdk-reference/justaname-core-sdk/interfaces/emptyheaders)
* [EnsDomainByChainId](/sdk-reference/justaname-core-sdk/interfaces/ensdomainbychainid)
* [Generals](/sdk-reference/justaname-core-sdk/interfaces/generals)
* [IHeaders](/sdk-reference/justaname-core-sdk/interfaces/iheaders)
* [IRequest](/sdk-reference/justaname-core-sdk/interfaces/irequest)
* [IResponse](/sdk-reference/justaname-core-sdk/interfaces/iresponse)
* [IRoute](/sdk-reference/justaname-core-sdk/interfaces/iroute)
* [IsSubnameAvailableRequest](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailablerequest)
* [IsSubnameAvailableResponse](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailableresponse)
* [IsSubnameAvailableRoute](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailableroute)
* [JustaNameConfig](/sdk-reference/justaname-core-sdk/interfaces/justanameconfig)
* [JustaNameConfigDefaults](/sdk-reference/justaname-core-sdk/interfaces/justanameconfigdefaults)
* [Network](/sdk-reference/justaname-core-sdk/interfaces/network)
* [NetworkWithProvider](/sdk-reference/justaname-core-sdk/interfaces/networkwithprovider)
* [OffchainResolverGetAllRequest](/sdk-reference/justaname-core-sdk/interfaces/offchainresolvergetallrequest)
* [OffchainResolverGetAllResponse](/sdk-reference/justaname-core-sdk/interfaces/offchainresolvergetallresponse)
* [OffchainResolversGetAllRoute](/sdk-reference/justaname-core-sdk/interfaces/offchainresolversgetallroute)
* [OffchainResolversParams](/sdk-reference/justaname-core-sdk/interfaces/offchainresolversparams)
* [PaginatedResponse](/sdk-reference/justaname-core-sdk/interfaces/paginatedresponse)
* [Pagination](/sdk-reference/justaname-core-sdk/interfaces/pagination)
* [RecordResponse](/sdk-reference/justaname-core-sdk/interfaces/recordresponse)
* [RequestChallengeRequest](/sdk-reference/justaname-core-sdk/interfaces/requestchallengerequest)
* [RequestChallengeResponse](/sdk-reference/justaname-core-sdk/interfaces/requestchallengeresponse)
* [RequestChallengeRoute](/sdk-reference/justaname-core-sdk/interfaces/requestchallengeroute)
* [RequestSignInParams](/sdk-reference/justaname-core-sdk/interfaces/requestsigninparams)
* [ROUTES](/sdk-reference/justaname-core-sdk/interfaces/routes)
* [SanitizedRecords](/sdk-reference/justaname-core-sdk/interfaces/sanitizedrecords)
* [SigninConfig](/sdk-reference/justaname-core-sdk/interfaces/signinconfig)
* [SignInFunctionParams](/sdk-reference/justaname-core-sdk/interfaces/signinfunctionparams)
* [SignInParams](/sdk-reference/justaname-core-sdk/interfaces/signinparams)
* [SignInResponse](/sdk-reference/justaname-core-sdk/interfaces/signinresponse)
* [SiweConfig](/sdk-reference/justaname-core-sdk/interfaces/siweconfig)
* [SIWEHeaders](/sdk-reference/justaname-core-sdk/interfaces/siweheaders)
* [Socials](/sdk-reference/justaname-core-sdk/interfaces/socials)
* [SubnameAcceptRequest](/sdk-reference/justaname-core-sdk/interfaces/subnameacceptrequest)
* [SubnameAcceptRoute](/sdk-reference/justaname-core-sdk/interfaces/subnameacceptroute)
* [SubnameAddRequest](/sdk-reference/justaname-core-sdk/interfaces/subnameaddrequest)
* [SubnameAddRoute](/sdk-reference/justaname-core-sdk/interfaces/subnameaddroute)
* [SubnameChallengeParams](/sdk-reference/justaname-core-sdk/interfaces/subnamechallengeparams)
* [SubnameChallengeSiweConfig](/sdk-reference/justaname-core-sdk/interfaces/subnamechallengesiweconfig)
* [SubnameGetAllByAddressRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressrequest)
* [SubnameGetAllByAddressResponse](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressresponse)
* [SubnameGetAllByAddressRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressroute)
* [SubnameGetAllByDomainChainIdRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidrequest)
* [SubnameGetAllByDomainChainIdResponse](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidresponse)
* [SubnameGetAllByDomainChainIdRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidroute)
* [SubnameGetAllByEnsDomainWithCountApiResponse](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountapiresponse)
* [SubnameGetAllByEnsDomainWithCountRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountrequest)
* [SubnameGetAllByEnsDomainWithCountResponse](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountresponse)
* [SubnameGetAllByEnsDomainWithCountRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountroute)
* [SubnameGetBySubnameRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamegetbysubnamerequest)
* [SubnameGetBySubnameRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamegetbysubnameroute)
* [SubnameGetInvitationsByAddressRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressrequest)
* [SubnameGetInvitationsByAddressResponse](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressresponse)
* [SubnameGetInvitationsByAddressRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressroute)
* [SubnameRecordsRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamerecordsrequest)
* [SubnameRecordsRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamerecordsroute)
* [SubnameRejectRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamerejectrequest)
* [SubnameRejectRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamerejectroute)
* [SubnameReserveRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamereserverequest)
* [SubnameReserveRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamereserveroute)
* [SubnameResponse](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)
* [SubnameRevokeRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamerevokerequest)
* [SubnameRevokeRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamerevokeroute)
* [SubnamesConfig](/sdk-reference/justaname-core-sdk/interfaces/subnamesconfig)
* [SubnameSearchRequest](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchrequest)
* [SubnameSearchResponse](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchresponse)
* [SubnameSearchRoute](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchroute)
* [SubnameUpdateRequest](/sdk-reference/justaname-core-sdk/interfaces/subnameupdaterequest)
* [SubnameUpdateRoute](/sdk-reference/justaname-core-sdk/interfaces/subnameupdateroute)
* [Text](/sdk-reference/justaname-core-sdk/interfaces/text)
* [TextRecord](/sdk-reference/justaname-core-sdk/interfaces/textrecord)
* [VerifyChallengeRequest](/sdk-reference/justaname-core-sdk/interfaces/verifychallengerequest)
* [VerifyChallengeResponse](/sdk-reference/justaname-core-sdk/interfaces/verifychallengeresponse)

### Type Aliases

* [AddressType](/sdk-reference/justaname-core-sdk/type-aliases/addresstype)
* [ChainId](/sdk-reference/justaname-core-sdk/type-aliases/chainid)
* [CoinAndDetails](/sdk-reference/justaname-core-sdk/type-aliases/coinanddetails)
* [CoinTypeKeys](/sdk-reference/justaname-core-sdk/type-aliases/cointypekeys)
* [CoinTypeMap](/sdk-reference/justaname-core-sdk/type-aliases/cointypemap)
* [EnsDomains](/sdk-reference/justaname-core-sdk/type-aliases/ensdomains)
* [GeneralsIdentifier](/sdk-reference/justaname-core-sdk/type-aliases/generalsidentifier)
* [GeneralsName](/sdk-reference/justaname-core-sdk/type-aliases/generalsname)
* [MakeOptionalProps](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)
* [Networks](/sdk-reference/justaname-core-sdk/type-aliases/networks)
* [NetworksWithProvider](/sdk-reference/justaname-core-sdk/type-aliases/networkswithprovider)
* [PartialAddressJson](/sdk-reference/justaname-core-sdk/type-aliases/partialaddressjson)
* [SocialDetails](/sdk-reference/justaname-core-sdk/type-aliases/socialdetails)
* [SocialsIdentifier](/sdk-reference/justaname-core-sdk/type-aliases/socialsidentifier)
* [SocialsName](/sdk-reference/justaname-core-sdk/type-aliases/socialsname)
* [SupportedCoins](/sdk-reference/justaname-core-sdk/type-aliases/supportedcoins)
* [SupportedGeneralsNames](/sdk-reference/justaname-core-sdk/type-aliases/supportedgeneralsnames)
* [SupportedSocialsNames](/sdk-reference/justaname-core-sdk/type-aliases/supportedsocialsnames)

### Variables

* [coinTypeMap](/sdk-reference/justaname-core-sdk/variables/cointypemap)
* [GENERAL\_FIELDS](/sdk-reference/justaname-core-sdk/variables/general_fields)
* [Routes](/sdk-reference/justaname-core-sdk/variables/routes)
* [SUPPORTED\_SOCIALS](/sdk-reference/justaname-core-sdk/variables/supported_socials)

### Functions

* [createAddresses](/sdk-reference/justaname-core-sdk/functions/createaddresses)
* [createGenerals](/sdk-reference/justaname-core-sdk/functions/creategenerals)
* [createSocialsAndOthers](/sdk-reference/justaname-core-sdk/functions/createsocialsandothers)
* [getCoinTypeDetails](/sdk-reference/justaname-core-sdk/functions/getcointypedetails)
* [sanitizeAddresses](/sdk-reference/justaname-core-sdk/functions/sanitizeaddresses)
* [sanitizeRecords](/sdk-reference/justaname-core-sdk/functions/sanitizerecords)
* [sanitizeTexts](/sdk-reference/justaname-core-sdk/functions/sanitizetexts)


# classes


# ApiKeyRequiredException

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / ApiKeyRequiredException

## Class: ApiKeyRequiredException

### Extends

* `Error`

### Constructors

#### new ApiKeyRequiredException()

> **new ApiKeyRequiredException**(`message`): [`ApiKeyRequiredException`](/sdk-reference/justaname-core-sdk/classes/apikeyrequiredexception)

**Parameters**

• **message**: `string`

**Returns**

[`ApiKeyRequiredException`](/sdk-reference/justaname-core-sdk/classes/apikeyrequiredexception)

**Overrides**

`Error.constructor`

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/ApiKeyRequired.exception.ts:2](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/ApiKeyRequired.exception.ts#L2)

### Properties

#### cause?

> `optional` **cause**: `unknown`

**Inherited from**

`Error.cause`

**Defined in**

node\_modules/typescript/lib/lib.es2022.error.d.ts:24

***

#### message

> **message**: `string`

**Inherited from**

`Error.message`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1077

***

#### name

> **name**: `string`

**Inherited from**

`Error.name`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1076

***

#### stack?

> `optional` **stack**: `string`

**Inherited from**

`Error.stack`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1078

***

#### prepareStackTrace()?

> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any`

Optional override for formatting stack traces

**Parameters**

• **err**: `Error`

• **stackTraces**: `CallSite`\[]

**Returns**

`any`

**See**

<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>

**Inherited from**

`Error.prepareStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:11

***

#### stackTraceLimit

> `static` **stackTraceLimit**: `number`

**Inherited from**

`Error.stackTraceLimit`

**Defined in**

node\_modules/@types/node/globals.d.ts:13

### Methods

#### apiKeyRequired()

> `static` **apiKeyRequired**(): [`ApiKeyRequiredException`](/sdk-reference/justaname-core-sdk/classes/apikeyrequiredexception)

**Returns**

[`ApiKeyRequiredException`](/sdk-reference/justaname-core-sdk/classes/apikeyrequiredexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/ApiKeyRequired.exception.ts:6](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/ApiKeyRequired.exception.ts#L6)

***

#### captureStackTrace()

> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`

Create .stack property on a target object

**Parameters**

• **targetObject**: `object`

• **constructorOpt?**: `Function`

**Returns**

`void`

**Inherited from**

`Error.captureStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:4


# InvalidConfigurationException

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / InvalidConfigurationException

## Class: InvalidConfigurationException

### Extends

* `Error`

### Constructors

#### new InvalidConfigurationException()

> **new InvalidConfigurationException**(`message`): [`InvalidConfigurationException`](/sdk-reference/justaname-core-sdk/classes/invalidconfigurationexception)

**Parameters**

• **message**: `string`

**Returns**

[`InvalidConfigurationException`](/sdk-reference/justaname-core-sdk/classes/invalidconfigurationexception)

**Overrides**

`Error.constructor`

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidConfiguration.exception.ts:2](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidConfiguration.exception.ts#L2)

### Properties

#### cause?

> `optional` **cause**: `unknown`

**Inherited from**

`Error.cause`

**Defined in**

node\_modules/typescript/lib/lib.es2022.error.d.ts:24

***

#### message

> **message**: `string`

**Inherited from**

`Error.message`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1077

***

#### name

> **name**: `string`

**Inherited from**

`Error.name`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1076

***

#### stack?

> `optional` **stack**: `string`

**Inherited from**

`Error.stack`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1078

***

#### prepareStackTrace()?

> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any`

Optional override for formatting stack traces

**Parameters**

• **err**: `Error`

• **stackTraces**: `CallSite`\[]

**Returns**

`any`

**See**

<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>

**Inherited from**

`Error.prepareStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:11

***

#### stackTraceLimit

> `static` **stackTraceLimit**: `number`

**Inherited from**

`Error.stackTraceLimit`

**Defined in**

node\_modules/@types/node/globals.d.ts:13

### Methods

#### captureStackTrace()

> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`

Create .stack property on a target object

**Parameters**

• **targetObject**: `object`

• **constructorOpt?**: `Function`

**Returns**

`void`

**Inherited from**

`Error.captureStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:4

***

#### missingHeaders()

> `static` **missingHeaders**(`headers`): [`InvalidConfigurationException`](/sdk-reference/justaname-core-sdk/classes/invalidconfigurationexception)

**Parameters**

• **headers**: `string`\[]

**Returns**

[`InvalidConfigurationException`](/sdk-reference/justaname-core-sdk/classes/invalidconfigurationexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidConfiguration.exception.ts:11](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidConfiguration.exception.ts#L11)

***

#### missingParameters()

> `static` **missingParameters**(`parameters`): [`InvalidConfigurationException`](/sdk-reference/justaname-core-sdk/classes/invalidconfigurationexception)

**Parameters**

• **parameters**: `string`\[]

**Returns**

[`InvalidConfigurationException`](/sdk-reference/justaname-core-sdk/classes/invalidconfigurationexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidConfiguration.exception.ts:7](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidConfiguration.exception.ts#L7)


# InvalidENSException

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / InvalidENSException

## Class: InvalidENSException

### Extends

* `Error`

### Constructors

#### new InvalidENSException()

> **new InvalidENSException**(`message`): [`InvalidENSException`](/sdk-reference/justaname-core-sdk/classes/invalidensexception)

**Parameters**

• **message**: `string`

**Returns**

[`InvalidENSException`](/sdk-reference/justaname-core-sdk/classes/invalidensexception)

**Overrides**

`Error.constructor`

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidENS.exception.ts:2](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidENS.exception.ts#L2)

### Properties

#### cause?

> `optional` **cause**: `unknown`

**Inherited from**

`Error.cause`

**Defined in**

node\_modules/typescript/lib/lib.es2022.error.d.ts:24

***

#### message

> **message**: `string`

**Inherited from**

`Error.message`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1077

***

#### name

> **name**: `string`

**Inherited from**

`Error.name`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1076

***

#### stack?

> `optional` **stack**: `string`

**Inherited from**

`Error.stack`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1078

***

#### prepareStackTrace()?

> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any`

Optional override for formatting stack traces

**Parameters**

• **err**: `Error`

• **stackTraces**: `CallSite`\[]

**Returns**

`any`

**See**

<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>

**Inherited from**

`Error.prepareStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:11

***

#### stackTraceLimit

> `static` **stackTraceLimit**: `number`

**Inherited from**

`Error.stackTraceLimit`

**Defined in**

node\_modules/@types/node/globals.d.ts:13

### Methods

#### captureStackTrace()

> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`

Create .stack property on a target object

**Parameters**

• **targetObject**: `object`

• **constructorOpt?**: `Function`

**Returns**

`void`

**Inherited from**

`Error.captureStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:4

***

#### chainNotSupported()

> `static` **chainNotSupported**(`chainId`): [`InvalidENSException`](/sdk-reference/justaname-core-sdk/classes/invalidensexception)

**Parameters**

• **chainId**: `string`

**Returns**

[`InvalidENSException`](/sdk-reference/justaname-core-sdk/classes/invalidensexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidENS.exception.ts:11](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidENS.exception.ts#L11)

***

#### notRegisteredENS()

> `static` **notRegisteredENS**(`ENS`): [`InvalidENSException`](/sdk-reference/justaname-core-sdk/classes/invalidensexception)

**Parameters**

• **ENS**: `string`

**Returns**

[`InvalidENSException`](/sdk-reference/justaname-core-sdk/classes/invalidensexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidENS.exception.ts:6](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidENS.exception.ts#L6)


# InvalidSignInException

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / InvalidSignInException

## Class: InvalidSignInException

### Extends

* `Error`

### Constructors

#### new InvalidSignInException()

> **new InvalidSignInException**(`message`): [`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Parameters**

• **message**: `string`

**Returns**

[`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Overrides**

`Error.constructor`

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts:2](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts#L2)

### Properties

#### cause?

> `optional` **cause**: `unknown`

**Inherited from**

`Error.cause`

**Defined in**

node\_modules/typescript/lib/lib.es2022.error.d.ts:24

***

#### message

> **message**: `string`

**Inherited from**

`Error.message`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1077

***

#### name

> **name**: `string`

**Inherited from**

`Error.name`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1076

***

#### stack?

> `optional` **stack**: `string`

**Inherited from**

`Error.stack`

**Defined in**

node\_modules/typescript/lib/lib.es5.d.ts:1078

***

#### prepareStackTrace()?

> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any`

Optional override for formatting stack traces

**Parameters**

• **err**: `Error`

• **stackTraces**: `CallSite`\[]

**Returns**

`any`

**See**

<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>

**Inherited from**

`Error.prepareStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:11

***

#### stackTraceLimit

> `static` **stackTraceLimit**: `number`

**Inherited from**

`Error.stackTraceLimit`

**Defined in**

node\_modules/@types/node/globals.d.ts:13

### Methods

#### captureStackTrace()

> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`

Create .stack property on a target object

**Parameters**

• **targetObject**: `object`

• **constructorOpt?**: `Function`

**Returns**

`void`

**Inherited from**

`Error.captureStackTrace`

**Defined in**

node\_modules/@types/node/globals.d.ts:4

***

#### chainIdMismatch()

> `static` **chainIdMismatch**(`chainId`, `signedChainId`): [`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Parameters**

• **chainId**: `string`

• **signedChainId**: `string`

**Returns**

[`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts:11](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts#L11)

***

#### chainIdNotSupported()

> `static` **chainIdNotSupported**(`chainId`): [`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Parameters**

• **chainId**: `string`

**Returns**

[`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts:21](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts#L21)

***

#### domainMismatch()

> `static` **domainMismatch**(`domain`, `signedDomain`): [`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Parameters**

• **domain**: `string`

• **signedDomain**: `string`

**Returns**

[`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts:6](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts#L6)

***

#### nonceMismatch()

> `static` **nonceMismatch**(`nonce`, `signedNonce`): [`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Parameters**

• **nonce**: `string`

• **signedNonce**: `string`

**Returns**

[`InvalidSignInException`](/sdk-reference/justaname-core-sdk/classes/invalidsigninexception)

**Defined in**

[packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts:16](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/errors/InvalidSignIn.exception.ts#L16)


# JustaName

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / JustaName

## Class: JustaName

The main class for the JustaName SDK.

### Classdesc

The main class for the JustaName SDK.

### Example

```typescript
import { JustaName } from '@justaname.id/sdk';

const configuration = {
 apiKey: 'your-api-key',
 networks: [
 {
 chainId: 1,
 providerUrl: 'https://mainnet.infura.io/v3/your-infura-key'
 },
 ],
 ensDomains: ['justan.id']
 };

 const justaName = JustaName.init(configuration);

```

### Constructors

#### new JustaName()

> **new JustaName**(`siwe`, `subnames`, `offchainResolvers`, `signIn`, `mApps`): [`JustaName`](/sdk-reference/justaname-core-sdk/classes/justaname)

**Parameters**

• **siwe**: [`SubnameChallenge`](/sdk-reference/justaname-core-sdk/classes/subnamechallenge)

• **subnames**: [`Subnames`](/sdk-reference/justaname-core-sdk/classes/subnames)

• **offchainResolvers**: [`OffchainResolvers`](/sdk-reference/justaname-core-sdk/classes/offchainresolvers)

• **signIn**: [`SignIn`](/sdk-reference/justaname-core-sdk/classes/signin)

• **mApps**: [`MApps`](broken://pages/CaUJ2AYux8ehqr83NTEa)

**Returns**

[`JustaName`](/sdk-reference/justaname-core-sdk/classes/justaname)

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:78](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L78)

### Properties

#### mApps

> **mApps**: [`MApps`](broken://pages/CaUJ2AYux8ehqr83NTEa)

The MApps feature.

**Memberof**

JustaName

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:76](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L76)

***

#### offchainResolvers

> **offchainResolvers**: [`OffchainResolvers`](/sdk-reference/justaname-core-sdk/classes/offchainresolvers)

The offchainResolvers feature.

**Memberof**

JustaName

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:60](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L60)

***

#### signIn

> **signIn**: [`SignIn`](/sdk-reference/justaname-core-sdk/classes/signin)

The signIn feature.

**Memberof**

JustaName

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:68](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L68)

***

#### siwe

> **siwe**: [`SubnameChallenge`](/sdk-reference/justaname-core-sdk/classes/subnamechallenge)

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:44](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L44)

***

#### subnames

> **subnames**: [`Subnames`](/sdk-reference/justaname-core-sdk/classes/subnames)

The subnames feature.

**Memberof**

JustaName

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:52](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L52)

### Methods

#### createNetworks()

> `static` **createNetworks**(`networks`): [`NetworksWithProvider`](/sdk-reference/justaname-core-sdk/type-aliases/networkswithprovider)

**Parameters**

• **networks**: [`Networks`](/sdk-reference/justaname-core-sdk/type-aliases/networks) = `[]`

**Returns**

[`NetworksWithProvider`](/sdk-reference/justaname-core-sdk/type-aliases/networkswithprovider)

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:160](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L160)

***

#### init()

> `static` **init**(`configuration`): [`JustaName`](/sdk-reference/justaname-core-sdk/classes/justaname)

**Parameters**

• **configuration**: [`JustaNameConfig`](/sdk-reference/justaname-core-sdk/interfaces/justanameconfig)<[`Configuration`](/sdk-reference/justaname-core-sdk/interfaces/configuration), [`Networks`](/sdk-reference/justaname-core-sdk/type-aliases/networks), `undefined` | [`EnsDomains`](/sdk-reference/justaname-core-sdk/type-aliases/ensdomains), `undefined` | [`ChainId`](/sdk-reference/justaname-core-sdk/type-aliases/chainid)> = `{}`

**Returns**

[`JustaName`](/sdk-reference/justaname-core-sdk/classes/justaname)

**Defined in**

[packages/@justaname.id/sdk/src/lib/justaname/index.ts:92](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/justaname/index.ts#L92)


# OffchainResolvers

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / OffchainResolvers

## Class: OffchainResolvers

### Constructors

#### new OffchainResolvers()

> **new OffchainResolvers**(`params`): [`OffchainResolvers`](/sdk-reference/justaname-core-sdk/classes/offchainresolvers)

**Parameters**

• **params**: [`OffchainResolversParams`](/sdk-reference/justaname-core-sdk/interfaces/offchainresolversparams)

**Returns**

[`OffchainResolvers`](/sdk-reference/justaname-core-sdk/classes/offchainresolvers)

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/offchain-resolvers/index.ts:12](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/offchain-resolvers/index.ts#L12)

### Methods

#### getAllOffchainResolvers()

> **getAllOffchainResolvers**(): `Promise`<[`OffchainResolverGetAllResponse`](/sdk-reference/justaname-core-sdk/interfaces/offchainresolvergetallresponse)>

**Returns**

`Promise`<[`OffchainResolverGetAllResponse`](/sdk-reference/justaname-core-sdk/interfaces/offchainresolvergetallresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/offchain-resolvers/index.ts:17](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/offchain-resolvers/index.ts#L17)


# SignIn

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / SignIn

## Class: SignIn

### Constructors

#### new SignIn()

> **new SignIn**(`params`): [`SignIn`](/sdk-reference/justaname-core-sdk/classes/signin)

**Parameters**

• **params**: [`SignInParams`](/sdk-reference/justaname-core-sdk/interfaces/signinparams)

**Returns**

[`SignIn`](/sdk-reference/justaname-core-sdk/classes/signin)

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts:30](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts#L30)

### Methods

#### generateNonce()

> **generateNonce**(): `string`

**Returns**

`string`

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts:152](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts#L152)

***

#### requestSignIn()

> **requestSignIn**(`params`): `string`

**Parameters**

• **params**: [`RequestSignInParams`](/sdk-reference/justaname-core-sdk/interfaces/requestsigninparams)

**Returns**

`string`

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts:38](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts#L38)

***

#### signIn()

> **signIn**(`params`): `Promise`<[`SignInResponse`](/sdk-reference/justaname-core-sdk/interfaces/signinresponse)>

**Parameters**

• **params**: [`SignInFunctionParams`](/sdk-reference/justaname-core-sdk/interfaces/signinfunctionparams)

**Returns**

`Promise`<[`SignInResponse`](/sdk-reference/justaname-core-sdk/interfaces/signinresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts:76](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/sign-in/index.ts#L76)


# SubnameChallenge

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / SubnameChallenge

## Class: SubnameChallenge

### Constructors

#### new SubnameChallenge()

> **new SubnameChallenge**(`params`): [`SubnameChallenge`](/sdk-reference/justaname-core-sdk/classes/subnamechallenge)

**Parameters**

• **params**: [`SubnameChallengeParams`](/sdk-reference/justaname-core-sdk/interfaces/subnamechallengeparams)

**Returns**

[`SubnameChallenge`](/sdk-reference/justaname-core-sdk/classes/subnamechallenge)

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subname-challenge/index.ts:50](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subname-challenge/index.ts#L50)

### Methods

#### requestChallenge()

> **requestChallenge**(`params`): `Promise`<[`RequestChallengeResponse`](/sdk-reference/justaname-core-sdk/interfaces/requestchallengeresponse)>

Sends a request to initiate a challenge.

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`RequestChallengeRequest`](/sdk-reference/justaname-core-sdk/interfaces/requestchallengerequest), `"origin"` | `"domain"` | `"chainId"` | `"ttl"`>, `never`>

The request parameters.

**Returns**

`Promise`<[`RequestChallengeResponse`](/sdk-reference/justaname-core-sdk/interfaces/requestchallengeresponse)>

* A promise that resolves with the response.

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subname-challenge/index.ts:64](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subname-challenge/index.ts#L64)

***

#### verifyMessage()

> **verifyMessage**(`params`): `Promise`<[`VerifyChallengeResponse`](/sdk-reference/justaname-core-sdk/interfaces/verifychallengeresponse)>

Sends a request to verify a specific address using SIWE.

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`VerifyChallengeRequest`](/sdk-reference/justaname-core-sdk/interfaces/verifychallengerequest), `never`>, `never`>

The request parameters.

**Returns**

`Promise`<[`VerifyChallengeResponse`](/sdk-reference/justaname-core-sdk/interfaces/verifychallengeresponse)>

* A promise that resolves with the response.

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subname-challenge/index.ts:88](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subname-challenge/index.ts#L88)


# Subnames

[**@justaname.id/sdk**](/sdk-reference/justaname-core-sdk) • **Docs**

***

[@justaname.id/sdk](/sdk-reference/justaname-core-sdk/globals) / Subnames

## Class: Subnames

### Constructors

#### new Subnames()

> **new Subnames**(`params`): [`Subnames`](/sdk-reference/justaname-core-sdk/classes/subnames)

**Parameters**

• **params**: [`SubnamesConfig`](/sdk-reference/justaname-core-sdk/interfaces/subnamesconfig)

**Returns**

[`Subnames`](/sdk-reference/justaname-core-sdk/classes/subnames)

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:58](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L58)

### Methods

#### acceptSubname()

> **acceptSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameAcceptRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnameacceptrequest), `"chainId"` | `"ensDomain"`>, `"addresses"` | `"text"`> & `object`

• **headers**: [`ApiKeyHeaders`](/sdk-reference/justaname-core-sdk/interfaces/apikeyheaders) & [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:65](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L65)

***

#### addSubname()

> **addSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameAddRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnameaddrequest), `"chainId"` | `"ensDomain"`>, `"addresses"` | `"text"`> & `object`

• **headers**: [`ApiKeyHeaders`](/sdk-reference/justaname-core-sdk/interfaces/apikeyheaders) & [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:137](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L137)

***

#### getInvitationsByAddress()

> **getInvitationsByAddress**(`params`): `Promise`<[`SubnameGetInvitationsByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameGetInvitationsByAddressRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressrequest), `"coinType"` | `"chainId"`>, `"isClaimed"`>

**Returns**

`Promise`<[`SubnameGetInvitationsByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetinvitationsbyaddressresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:340](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L340)

***

#### getPrimaryNameByAddress()

> **getPrimaryNameByAddress**(`params`): `Promise`<`PrimaryNameGetByAddressResponse`>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<`PrimaryNameGetByAddressRequest`, `"chainId"`>, `never`>

**Returns**

`Promise`<`PrimaryNameGetByAddressResponse`>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:439](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L439)

***

#### getRecords()

> **getRecords**(`params`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameRecordsRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamerecordsrequest), `"providerUrl"`>, `never`> & `object`

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:419](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L419)

***

#### getSubname()

> **getSubname**(`params`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameGetBySubnameRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetbysubnamerequest), `"chainId"`>, `never`>

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:302](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L302)

***

#### getSubnamesByAddress()

> **getSubnamesByAddress**(`params`): `Promise`<[`SubnameGetAllByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameGetAllByAddressRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressrequest), `"coinType"` | `"chainId"` | `"isClaimed"`>, `never`>

**Returns**

`Promise`<[`SubnameGetAllByAddressResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyaddressresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:320](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L320)

***

#### getSubnamesByEnsDomain()

> **getSubnamesByEnsDomain**(`params`): `Promise`<[`SubnameGetAllByDomainChainIdResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameGetAllByDomainChainIdRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidrequest), `"chainId"` | `"ensDomain"`>, `never`>

**Returns**

`Promise`<[`SubnameGetAllByDomainChainIdResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbydomainchainidresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:360](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L360)

***

#### getSubnamesByEnsDomainWithCount()

> **getSubnamesByEnsDomainWithCount**(`params`): `Promise`<[`SubnameGetAllByEnsDomainWithCountResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameGetAllByEnsDomainWithCountRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountrequest), `"chainId"`>, `never`>

**Returns**

`Promise`<[`SubnameGetAllByEnsDomainWithCountResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamegetallbyensdomainwithcountresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:283](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L283)

***

#### isSubnameAvailable()

> **isSubnameAvailable**(`params`): `Promise`<[`IsSubnameAvailableResponse`](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailableresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`IsSubnameAvailableRequest`](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailablerequest), `"chainId"`>, `never`>

**Returns**

`Promise`<[`IsSubnameAvailableResponse`](/sdk-reference/justaname-core-sdk/interfaces/issubnameavailableresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:401](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L401)

***

#### rejectSubname()

> **rejectSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameRejectRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamerejectrequest), `"chainId"` | `"ensDomain"`>, `never`>

• **headers**: [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:254](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L254)

***

#### reserveSubname()

> **reserveSubname**(`params`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameReserveRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamereserverequest), `"chainId"` | `"ensDomain"`>, `never`> & `object`

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:108](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L108)

***

#### revokeSubname()

> **revokeSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameRevokeRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamerevokerequest), `"chainId"` | `"ensDomain"`>, `never`> & `object`

• **headers**: [`ApiKeyHeaders`](/sdk-reference/justaname-core-sdk/interfaces/apikeyheaders) & [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:219](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L219)

***

#### searchSubnames()

> **searchSubnames**(`params`): `Promise`<[`SubnameSearchResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameSearchRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchrequest), `"chainId"`>, `never`>

**Returns**

`Promise`<[`SubnameSearchResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnamesearchresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:383](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L383)

***

#### updateSubname()

> **updateSubname**(`params`, `headers`): `Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Parameters**

• **params**: `Omit`<[`MakeOptionalProps`](/sdk-reference/justaname-core-sdk/type-aliases/makeoptionalprops)<[`SubnameUpdateRequest`](/sdk-reference/justaname-core-sdk/interfaces/subnameupdaterequest), `"chainId"` | `"ensDomain"`>, `"addresses"` | `"text"`> & `object`

• **headers**: [`SIWEHeaders`](/sdk-reference/justaname-core-sdk/interfaces/siweheaders)

**Returns**

`Promise`<[`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse)>

**Defined in**

[packages/@justaname.id/sdk/src/lib/features/subnames/index.ts:188](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/features/subnames/index.ts#L188)


# functions


# createAddresses

Creates detailed address information from coin data by enriching coin objects with coin type details.

***

## Usage

```typescript
import { createAddresses } from '@justaname.id/sdk'

const addresses = createAddresses([
  { id: 60, name: 'ETH', value: '0x1234567890abcdef...' },
  { id: 0, name: 'BTC', value: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa' }
])
```

***

## Returns

[`CoinAndDetails`](/sdk-reference/justaname-core-sdk/type-aliases/coinanddetails)\[] - An array of objects containing:

* `id`: The coin type identifier (number)
* `name`: The original name from the coin object
* `value`: The cryptocurrency address
* `coin`: The full name of the cryptocurrency
* `symbol`: The symbol of the cryptocurrency
* `coinType`: The coin type as a string

## Parameters

* **coins**: [`Coin`](/sdk-reference/justaname-core-sdk/interfaces/coin)\[] - Array of coin objects with id, name, and value

## Defined in

[packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts:42](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts#L42)


# createGenerals

Filters text records to return only general profile fields (avatar, banner, header, display, description, url, location).

***

## Usage

```typescript
import { createGenerals } from '@justaname.id/sdk'

// Basic usage
const generalTexts = createGenerals([
  { key: 'description', value: 'My personal description' },
  { key: 'url', value: 'https://example.com' },
  { key: 'email', value: 'contact@example.com' },
  { key: 'avatar', value: 'https://example.com/avatar.jpg' },
  { key: 'com.twitter', value: '@username' }
])

console.log(generalTexts)
// [
//   { key: 'description', value: 'My personal description' },
//   { key: 'url', value: 'https://example.com' },
//   { key: 'email', value: 'contact@example.com' },
//   { key: 'avatar', value: 'https://example.com/avatar.jpg' }
// ]
```

***

## Returns

[`Text`](/sdk-reference/justaname-core-sdk/interfaces/text)\[] - An array of text records with keys: `avatar`, `banner`, `header`, `display`, `description`, `url`, `location`

## Parameters

* **texts**: [`Text`](/sdk-reference/justaname-core-sdk/interfaces/text)\[] - Array of text records to filter

## Defined in

[packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts:74](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts#L74)


# createSocialsAndOthers

Separates supported social media records from other text records, returning social records with platform names and remaining non-general text records.

***

## Usage

```typescript
import { createSocialsAndOthers } from '@justaname.id/sdk'

// Basic usage
const [socials, others] = createSocialsAndOthers([
  { key: 'description', value: 'My personal description' },
  { key: 'com.twitter', value: '@username' },
  { key: 'com.github', value: 'githubuser' },
  { key: 'url', value: 'https://example.com' },
  { key: 'custom', value: 'custom value' }
])

console.log(socials)
// [
//   { key: 'com.twitter', value: '@username', name: 'Twitter' },
//   { key: 'com.github', value: 'githubuser', name: 'Github' }
// ]

console.log(others)
// [
//   { key: 'custom', value: 'custom value' }
// ]
```

***

## Supported Social Platforms

* Twitter (`com.twitter`)
* Facebook (`com.facebook`)
* Instagram (`com.instagram`)
* Reddit (`com.reddit`)
* X (`com.x`)
* Github (`com.github`)
* Email (`email`)
* Discord (`com.discord`)
* Telegram (`org.telegram`)

***

## Returns

[`SocialDetails`](/sdk-reference/justaname-core-sdk/type-aliases/socialdetails)\[], [`Text`](/sdk-reference/justaname-core-sdk/interfaces/text)\[] - A tuple containing:

* **First element**: Array of social media records with `name` property added
* **Second element**: Array of non-social, non-general text records

## Parameters

* **texts**: [`Text`](/sdk-reference/justaname-core-sdk/interfaces/text)\[] - Array of text records to separate

## Defined in

[packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts:51](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts#L51)


# getCoinTypeDetails

Retrieves detailed information about a specific cryptocurrency coin type from the supported coin types.

***

## Usage

```typescript
import { getCoinTypeDetails } from '@justaname.id/sdk'

// Basic usage
const ethDetails = getCoinTypeDetails('60')
console.log(ethDetails)
// {
//   coin: 'Ethereum',
//   symbol: 'eth',
//   coinType: '60'
// }

const btcDetails = getCoinTypeDetails('0')
console.log(btcDetails)
// {
//   coin: 'Bitcoin',
//   symbol: 'btc',
//   coinType: '0'
// }
```

***

## Supported Coin Types

The SDK supports all coin types from the [ENS address-encoder supported cryptocurrencies list](https://github.com/ensdomains/address-encoder/blob/master/docs/supported-cryptocurrencies.md). For unsupported coin types, returns `{ coin: 'NON', symbol: 'NON', coinType: '-1' }`.

***

## Returns

[`CoinType`](/sdk-reference/justaname-core-sdk/interfaces/cointype) - An object containing:

* `coin`: The full name of the cryptocurrency
* `symbol`: The symbol of the cryptocurrency
* `coinType`: The coin type identifier

## Parameters

* **cointype**: `string` - The coin type identifier string

## Defined in

[packages/@justaname.id/sdk/src/lib/utils/cointypes/index.ts:34](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/utils/cointypes/index.ts#L34)


# sanitizeAddresses

Converts address data from object or array format into a standardized array of address objects with numeric coin types.

***

## Usage

```typescript
import { sanitizeAddresses } from '@justaname.id/sdk'

// Object format
const addresses = sanitizeAddresses({
  '60': '0x1234567890abcdef1234567890abcdef12345678',
  '0': '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'
})

console.log(addresses)
// [
//   { coinType: 60, address: '0x1234567890abcdef1234567890abcdef12345678' },
//   { coinType: 0, address: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa' }
// ]

// Array format
const addresses2 = sanitizeAddresses([
  { coinType: '60', address: '0x1234567890abcdef1234567890abcdef12345678' },
  { coinType: '0', address: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa' }
])
```

***

## Returns

`undefined` | [`Address`](/sdk-reference/justaname-core-sdk/interfaces/address)\[] - An array of address objects with numeric coin types, or undefined if no addresses provided

## Parameters

* **addresses**: `undefined` | `Partial<object>` | [`AddressWithTypedCoins`](/sdk-reference/justaname-core-sdk/interfaces/addresswithtypedcoins)\[] - Address data in object or array format

## Defined in

[packages/@justaname.id/sdk/src/lib/utils/transformJsonToRecord/index.ts:13](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/utils/transformJsonToRecord/index.ts#L13)


# sanitizeRecords

Transforms subname response data into a structured format with organized text records, addresses, and metadata.

***

## Usage

```typescript
import { sanitizeRecords } from '@justaname.id/sdk'

// Sample subname response
const subnameResponse = {
  name: 'alice.justaname.eth',
  owner: '0x1234567890abcdef1234567890abcdef12345678',
  records: {
    texts: [
      { key: 'description', value: 'Web3 developer and designer' },
      { key: 'url', value: 'https://alice.eth' },
      { key: 'email', value: 'alice@example.com' },
      { key: 'avatar', value: 'https://example.com/avatar.jpg' },
      { key: 'com.twitter', value: '@alice_dev' },
      { key: 'com.github', value: 'alice-dev' }
    ],
    coins: [
    { id: 60, name: 'ETH', value: '0x1234567890abcdef1234567890abcdef12345678' },
    { id: 0, name: 'BTC', value: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa' }
  ],
    contentHash: {
      protocolType: 'ipfs',
      decoded: 'QmHash1234567890abcdef'
    }
  }
}

const sanitized = sanitizeRecords(subnameResponse)

console.log(sanitized)
// {
//   avatar: 'https://example.com/avatar.jpg',
//   description: 'Web3 developer and designer',
//   url: 'https://alice.eth',
//   email: 'alice@example.com',
//   ethAddress: { id: 60, name: 'ETH', value: '0x1234...', ... },
//   generals: [
//     { key: 'description', value: 'Web3 developer and designer' },
//     { key: 'url', value: 'https://alice.eth' },
//     { key: 'email', value: 'alice@example.com' },
//     { key: 'avatar', value: 'https://example.com/avatar.jpg' }
//   ],
//   socials: [
//     { key: 'com.twitter', value: '@alice_dev', name: 'Twitter' },
//     { key: 'com.github', value: 'alice-dev', name: 'Github' }
//   ],
//   otherAddresses: [{ id: 0, name: 'BTC', value: '1A1z...', ... }],
//   allAddresses: [...],
//   allTexts: [...],
//   contentHash: { protocolType: 'ipfs', decoded: 'QmHash1234567890abcdef' },
//   contentHashUri: 'ipfs://QmHash1234567890abcdef'
// }
```

***

## Returns

[`SanitizedRecords`](/sdk-reference/justaname-core-sdk/interfaces/sanitizedrecords) - A structured object containing:

* `avatar`, `banner`, `header`, `display`, `email`, `description`, `url` - Extracted profile fields
* `ethAddress` - Ethereum address with coin details
* `otherAddresses` - Non-ETH addresses with coin details
* `generals` - General text records (avatar, description, url, etc.)
* `socials` - Social media records with platform names
* `allTexts` - All text records
* `contentHash` - Content hash information
* `contentHashUri` - Formatted content hash URI

## Parameters

* **subnameResponse**: `undefined` | [`SubnameResponse`](/sdk-reference/justaname-core-sdk/interfaces/subnameresponse) - The subname response data to sanitize

## Defined in

[packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts:84](https://github.com/JustaName-id/JustaName-sdk/blob/dc845c10af242e3ca87d95ef392516ac0bfa8b95/packages/@justaname.id/sdk/src/lib/utils/sanitizeRecords/index.ts#L84)




---

[Next Page](/llms-full.txt/1)

