API Reference

entri.showEntri(config)

This method launches the Entri modal window. config is an object with the following properties:

Property

Type

Required?

Default

Description

applicationId

string

Yes

N/A

The ID of your application (set in the dashboard)

token

string

Yes

N/A

A JSON web token. Must be fetched in each session, see Installation.

dnsRecords

array of DNSRecord objects (see below)

Yes

N/A

The DNS records you wish to configure for your users (see below)

prefilledDomain

string

No, unless forceManualSetup is set to true

N/A

A domain to pre-fill if you've collected it before the Entri modal, e.g. example.com

userId

string

No

N/A

A unique ID so that you can match Entri webhook events to the user

supportForSubdomains

boolean

No

true

If your application allows subdomains, enable this

forceSubdomain

boolean

No

false

If your application requires subdomains, enable this

manualSetupDocumentation

string

No

""

Where you currently provide documentation on how to set up DNS. If users are trying to set up their DNS manually and need help, we will send them to this page. e.g. https://example.com/docs/dns-setup

enableDkim

boolean

No

false

If your application requires users to set up DKIM through their email provider (and your app does not send emails directly), enable this. This is common for applications that provide email automation using an external service like Google Workspace or Microsoft 365.

defaultSubdomain

string

No

""

If you would like to pre fill the subdomain field with text then enter the desired sub domain here.

hostRequired

boolean

No, unless you use the {SUBDOMAIN} variable

true

If the {SUBDOMAIN} variable is used but is null (no subdomain inputted by the user) then the {SUBDOMAIN} value will default to be www. See Dynamic configuration variables based on the user-inputted domain.

wwwRedirect

boolean

No

false

When feasible, Entri will automatically redirect site.com to www.site.com using the preferred method of the DNS provider. Certain providers prevent Entri from automatically setting this up. When that is the case, Entri shows a helper UI to the user that explains how to do this manually.

locale

string

No

en

To load Entri in a specific language. Supported languages include: en, es, pt, fr, ft, it, de, nl, pl, tr

forceManualSetup

boolean

No

false

Forces Entri to use the manual setup flow. If set to true then the prefilledDomain becomes required.

DNSRecord object

DNS records have the following properties:

Property

Type

Example

Required?

type

string (see below)

CNAME

Yes

host

string

www

Yes

value

string

m.example.com

Yes

ttl

integer

300

Yes

priority

integer

10

Only for MX records

Supported Record Types

Type

Description

A

Holds the IP address of a domain.

AAAA

The AAAA record is conceptually similar to the A record, but it allows you to specify the IPv6 address of the server, rather than the IPv4.

CNAME

Forwards one domain or subdomain to another domain. Does not provide an IP address.

MX

Directs email to an email server.

TXT

Stores text strings. For special uses of the TXT record, see Handling DKIM, SPF, and DMARC records.

entri.checkDomain(domain, config)

This asynchronous method checks if Entri supports automatic setup for a particular domain. It accepts two arguments:

Argument

Type

Example

domain

string - a domain with no subdomain

example.com

config

Entri configuration object

See above

Webhooks

Entri sends JSON data via webhook to notify your backend when events occur. For example:

{
  "id": "028b5078-8fed-4ffb-8e3e-3e6e6d8214b4",
  "user_id": "sample-user",
  "domain": "smallbusiness.com",
  "type": "domain.added",
  "propagation_status": "success",
  "dkim_status": "success",
  "redirection_status": "exempt",
  "data": {
    "records_propagated": [
      {
        "type": "A",
        "host": "smallbusiness.com",
        "value": "54.153.2.220"
      },
      {
        "type": "CNAME",
        "host": "www",
        "value": "smallbusiness.com"
      }
    ],
    "records_non_propagated": [],
    "updated_objects": ["propagation_status"]
  }
}

The JSON object contains the following properties:

Property

Type

Description

id

string

Entri's ID for the webhook event

user_id

string

The user ID that your application can optionally send via the configuration object during setup (see the entri.showEntri method)

domain

string

The domain name set by your user

type

string

The event type. Options:

  • domain.added
  • domain.timeout

propagation_status

string

The DNS propagation status. Options:

  • success
  • pending
  • failure

dkim_status

string

Whether DKIM has been set up (see Handling DKIM, SPF, and DMARC Records). Options:

  • success
  • pending
  • failure
  • exempt

If this feature is disabled, the status will be exempt.

redirection_status

string

If the wwwRedirect feature was enabled for your applicationId, then Entri will check to confirm the status of the url redirect.

Options:

  • success
  • pending
  • failure
  • exempt

If this feature is disabled, the status will be exempt.

data.records_propagated

array of DNSRecord objects

See above

data.records_non_propagated

array of DNSRecord objects

See above

updated_objects

array of strings

The object properties that have been updated since the last webhook event.