@realtimeregister/api
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i @realtimeregister/api

Weekly Downloads

5

Version

1.0.0

License

MIT

Unpacked Size

428 kB

Total Files

71

Last publish

Collaborators

  • wiebren
  • rtr-kevinkoster