entrijs
v1.5.0
Published
Entri
Keywords
Readme
EntriJS
Use Entri with your JavaScript application.
For full developer documentation, see: https://developers.entri.com
Get started
Install the package
npm install entrijsor
yard add entrijsConnect a domain
import {connectDomain} from 'entrijs';
const config = {
applicationId: '123sample',
dnsRecords: [
{
type: "CNAME",
host: "www",
value: "m.test.com",
ttl: 300,
},
],
token: '345sample',
};
connectDomain(config);showEntri remains available as a deprecated alias of connectDomain.
Read more about the config object.
To close the modal:
import {close} from 'entrijs';
close();Check domain
See the full documentation.
import {checkDomain} from 'entrijs';
const init = async () => {
const result = await checkDomain('mydomain.com', config);
};Check records
Checks whether DNS records are already live on a domain. It takes a single config object with the domain inside, and every record comes back with an active flag. See the full documentation.
import {checkRecords} from 'entrijs';
const result = await checkRecords({
applicationId: '123sample',
token: '345sample',
domain: 'mydomain.com',
dnsRecords: [
{
type: 'CNAME',
host: 'www',
value: 'm.test.com',
ttl: 300,
},
],
});
// { domain: 'mydomain.com', dnsRecords: [{ type: 'CNAME', host: 'www', value: 'm.test.com', ttl: 300, active: true }] }Purchase domain
See the full documentation.
import {purchaseDomain} from 'entrijs';
purchaseDomain(config);Entri Unify
Launches Entri Unify, where the user can connect an existing domain or purchase a new one. Completed domains are enrolled in Entri Monitor unless the config sets monitor at the root or on any DNS record. See the full documentation.
import {showUnify} from 'entrijs';
showUnify(config);activateDomain remains available as a deprecated alias of showUnify.
Subscribe to events
Register callbacks for Entri events and get back an unsubscribe function. See the full documentation.
import {subscribe} from 'entrijs';
const unsubscribe = await subscribe('onEntriClose', (detail) => {
console.log('Entri closed', detail);
});