Skip to main content

Class: JustaName

The main class for the JustaName SDK.

Classdesc

The main class for the JustaName SDK.

Example

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

const configuration = {
apiKey: 'your-api-key'
};

const justaName = JustaName.init(configuration);

const requestChallengeResponse = await justaName.siwe.requestChallenge({
chainId: 1,
origin: 'http://localhost:3333',
address: '0x59c44836630760F97b74b569B379ca94c37B93ca',
domain: 'localhost',
ttl?: 120000,
});

Constructors

constructor

new JustaName(siwe, subnames): JustaName

Parameters

NameType
siweSiwe
subnamesSubnames

Returns

JustaName

Defined in

lib/justaname/index.ts:41

Properties

siwe

siwe: Siwe

Defined in

lib/justaname/index.ts:31


subnames

subnames: Subnames

The subnames feature.

Memberof

JustaName

Defined in

lib/justaname/index.ts:39

Methods

checkApiKey

checkApiKey(apiKey): void

Checks if the API key is present.

Parameters

NameType
apiKeystring

Returns

void

Throws

  • If the API key is not present.

Static

Defined in

lib/justaname/index.ts:74


init

init(configuration): JustaName

Initializes the JustaName SDK.

Parameters

NameTypeDescription
configurationConfigurationThe configuration object.

Returns

JustaName

  • A promise that resolves with the JustaName SDK.

Throws

  • If the API key is not present or if the API key is invalid.

Static

Defined in

lib/justaname/index.ts:57