@namefi/api-client
v0.0.0-pre.5
Published
API client for Namefi
Downloads
129
Keywords
Readme
Namefi API Client
This package is still in alpha. APIs and behavior may change without notice.
For Full docs
Table of Contents
Installation
npm install @namefi/api-clientUsage
import { createNamefiClient } from '@namefi/api-client';
const client = createNamefiClient({
authentication: {
apiKey: process.env.NAMEFI_API_KEY!,
type: 'API_KEY',
},
logger: true,
});
const domain = 'example.com';
const result = await client.search.checkAvailability({ domain });
if (result.availability) {
const order = await client.orders.registerDomain({
normalizedDomainName: domain,
durationInYears: 1,
});
console.log('Registered', order.id);
}