GlobalRegistrar

global-registrar. GlobalRegistrar

Class representing the global registrar

Constructor

new GlobalRegistrar(plugin)

Source:
Create a global registrar client
Example
(async () => {
    //get global variables
    require('dotenv').config();

    const {
        GlobalRegistrar
    } = require('global-registrar');
    const gr = new GlobalRegistrar({
        pluginName: 'global-registrar-plugin-gandi',
        pluginData: {
            apikey: process.env.GANDI_API_KEY
        }
    });
    console.log(await gr.listAvailableTLD());
})();
Parameters:
Name Type Description
plugin Object a plugin object with its name and required data

Methods

checkAvailability(domain) → {Boolean}

Source:
Checks if domain is publicly available for registration at the registrar. Takes domain name as string. Has to return true if domain is available and false if not. Null will be returned if the check couldnt be performed or an error occurs.
Example
await gr.checkAvailability('example.com')
Parameters:
Name Type Description
domain String The domain you want to check for
Returns:
True if domain is available for registration
Type
Boolean

checkPrice(domain) → {Number|Boolean}

Source:
Checks if domain is publicly available for registration at the registrar. Takes domain name as string. Returns the pricing information from the registrar or false if domain is not available for registration
Example
await gr.checkPrice('paulisttoll.eu')
Parameters:
Name Type Description
domain String The domain you want to check for
Returns:
price in USD for one year without taxes, false or null
Type
Number | Boolean

getDomainInfo(domain) → {Object}

Source:
Gives back information about the registration of a domain
Example
await gr.getDomainInfo('paulisttoll.eu')
Parameters:
Name Type Description
domain String The domain you want to get information about
Returns:
information about the domain
Type
Object

listAvailableTLD() → {Array}

Source:
Retrieves list of available tld names. Must return array with all available tld endings and nothing else.
Example
await gr.listAvailableTLD()
Returns:
Array of top level domains
Type
Array

registerDomain(domain, duration, registrant) → {Boolean}

Source:
Registers a domain
Example
await gr.registerDomain("paulisttoll.eu", 1, {
        email: "mail@example.com",
        lastName: "M├╝ller",
        firstName: "Karl",
        registrantType: 0,
        country: "Deutschland",
        countryCode: "DE",
        state: "Bayern",
        city: "Augsburg",
        zip: "86150",
        street: "Musterstra├če",
        houseNumber: "42",
        phone: '+491234567890'
    })
Parameters:
Name Type Description
domain String The domain you want to register
duration Number The duration to register the domain for in years.
registrant Registrant A Registrant object with information about the registrant must be provided
Returns:
Type
Boolean

renewDomain(domain, duration) → {Boolean}

Source:
Renews a domain.
Example
await gr.renewDomain("paulisttoll.eu", 2)
        //will prolong the registration of the domain paulisttoll.eu by 2 years
Parameters:
Name Type Description
domain String The domain you want to renew
duration Number The duration to renew the domain for in years.
Returns:
Type
Boolean

setDNSSEC(domain, dnssec) → {Boolean}

Source:
Sets the dnssec parameters for a domain at the registrar
Example
await gr.setNameServers('paulisttoll.eu',{
    "keyTag": 30909,
    "algorithm": 8,
    "digestType": 2,
    "digest": "E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CFC41A5766"
})
Parameters:
Name Type Description
domain String The domain you want to set the nameservers for
dnssec Dnssec Dnssec object with the dnssec parameters
Returns:
true on success
Type
Boolean

setNameServers(domain, nameservers) → {Boolean}

Source:
Sets the nameservers for a domain
Example
await gr.setNameServers('paulisttoll.eu',["tick.y.gy","trick.y.gy","track.y.gy"])
Parameters:
Name Type Description
domain String The domain you want to set the nameservers for
nameservers Array Array with the domain names of all nameservers
Returns:
true on success
Type
Boolean