Skip to content

realtimeregister/realtimeregister-ts

Repository files navigation

Realtime Register REST API - TypeScript SDK

NPM Version GitHub License

Official TypeScript SDK for our REST API.

pnpm add @realtimeregister/api

Supported APIs

Example usage

import RealtimeRegisterAPI from '@realtimeregister/api' import { AuthenticationError } from '@realimeregister/api/exceptions' // Or... const RealtimeRegisterAPI = require('@realtimeregister/api').default const { AuthenticationError } = require('@realtimeregister/api/exceptions')
const rtr = new RealtimeRegisterAPI({ apiKey: 'YOUR_API_KEY', customer: 'YOUR_CUSTOMER_HANDLE' }) // Get TLD metadata rtr.tld.info('nl').then((response) => { console.log(response) //Metadata(hash=..., applicableFor=..., metadata=..., provider=...) console.log(response.metadata) // {....} }).catch((err) => { if (err instanceof AuthenticationError) { console.log('Authentication error') } }) // Check domain rtr.domains.check('testdomain.com').then((response) => { console.log(response) /* {  * available: false,  * reason: 'test',  premium: false,  currency: 'USD',  price: 3000  * }   */ })

License

This project is licensed under the MIT license.

About

TypeScript client for the Realtime Register REST API

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 5