API Reference

entri.showEntri(config)

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

PropertyTypeRequired?DefaultDescription
applicationIdstringYesN/AThe ID of your application (set in the dashboard)
tokenstringYesN/AA JSON web token. Must be fetched in each session, see Installation.
dnsRecordsarray of DNSRecord objects (see below)YesN/AThe DNS records you wish to configure for your users (see below)
prefilledDomainstringNo, unless forceManualSetup is set to trueN/AA domain to pre-fill if you've collected it before the Entri modal, e.g. example.com
userIdstringNoN/AA unique ID so that you can match Entri webhook events to the user
supportForSubdomainsbooleanNotrueIf your application allows subdomains, enable this
forceSubdomainbooleanNofalseIf your application requires subdomains, enable this
manualSetupDocumentationstringNo""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>
enableDkimbooleanNofalseIf 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.
defaultSubdomainstringNo""If you would like to pre fill the subdomain field with text then enter the desired sub domain here.
hostRequiredbooleanNo, unless you use the {SUBDOMAIN} variabletrueIf 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.
wwwRedirectbooleanNofalseWhen 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.
localestringNoenTo load Entri in a specific language. Supported languages include: en, es, pt, fr, it, de, nl, pl, tr
forceManualSetupbooleanNofalseForces Entri to use the manual setup flow. If set to true then the prefilledDomain becomes required.

DNSRecord object

DNS records have the following properties:

PropertyTypeRequired?Example
typestring (see below)YesCNAME
hoststringYeswww
valuestringYesm.example.com
ttlintegerYes300
priorityintegerOnly for MX records10
fallbackValuestringNov=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDg9/gR+3J0mmugLjhpYOfQK9ytkEKnXM0kVdpu0UoykSPK7ChD+nRxFJbN2cxtvu8GrCNQwPTKbC0jimaSi0V2j3JndnRrECuYCqeZYcRmw2lYs18QnmJRfCpweKoaGtv9zERCkeHwLcTaLkrSHrRDf58WgERg8x/4ipBPIyZufwIDAQAB

onEntriClose Callback Event Data:lastStatus fields

These are the following potential values for lastStatus returned as part of the onEntriClosecallback event.

lastStatusDescription
FINISHED_SUCCESSFULLYThe user has successfully configured their domain using the automatic flow.
IN_PROGRESSThe user exited the Entri modal while the DNS setup was in progress.
EXISTING_RECORDSThe user exited the Entri modal when prompted if they want to override an existing set of DNS records.
LOGINThe user exited the Entri modal flow during the login process (when prompted for their login credentials and/or 2FA verification)
MANUAL_CONFIGURATIONThe user exited the Entri modal after manual DNS configuration instructions were presented.
EXIT_WITH_ERRORThe user exited the Entri modal after an error occurred.
DKIM_SETUPThe user exited the Entri modal after prompting

Supported Record Types

TypeDescription
AHolds the IP address of a domain.
AAAAThe 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.
CNAMEForwards one domain or subdomain to another domain. Does not provide an IP address.
CAAUsed to provide additional confirmation for the Certification Authority (CA) when validating an SSL certificate.
MXDirects email to an email server.
TXTStores 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:

ArgumentTypeExample
domainstring - a domain with no subdomainexample.com
configEntri configuration objectSee 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:

PropertyTypeDescription
idstringEntri's ID for the webhook event
user_idstringThe user ID that your application can optionally send via the configuration object during setup (see the entri.showEntri method)
domainstringThe domain name set by your user
typestringThe event type. Options:

- domain.added
- domain.timeout
propagation_statusstringThe DNS propagation status. Options:

- success
- pending
- failure
dkim_statusstringWhether DKIM has been set up (see Handling DKIM, SPF, and DMARC Records). Options:

- success
- pending
- failure
- exemptIf this feature is disabled, the status will be exempt.
redirection_statusstringIf the wwwRedirect feature was enabled for your applicationId, then Entri will check to confirm the status of the url redirect.

Options:

- success
- pending
- failure
- exemptIf this feature is disabled, the status will be exempt.
data.records_propagatedarray of DNSRecord objectsSee above
data.records_non_propagatedarray of DNSRecord objectsSee above
updated_objectsarray of stringsThe object properties that have been updated since the last webhook event.