Configure Entri
Configuring Entri requires just a few simple steps:
1. Set up your account
The first step to getting up and running with Entri is to configure your application display name and icon in the dashboard. These will be used in the Entri modal.
For the icon, we require a PNG or SVG with a 1:1 ratio. We recommend a white or transparent background.
From the dashboard, you can also access your application ID, webhook URL, and client secret, which you’ll need for the next steps.
2. Add Entri to Your Project
You have two options to add Entri to your project: via the <script>
tag or using the NPM package.
Option 1: Using the <script>
tag
You can include Entri by adding the following <script>
tag to your HTML file:
<script src="https://cdn.entri.com/entri.min.js"></script>
This approach allows you to directly load Entri from our CDN, making it easy to get started without additional configuration.
Option 2: Using the NPM Package
If you prefer to manage your dependencies via NPM, you can install the Entri package:
npm install entrijs
Then, you can import it into your project:
import Entri from 'entrijs';
3. Fetch the JSON web token (JWT)
To launch the Entri modal window in a session, you’ll need to fetch a JWT using the secret
key and applicationId
provided by the Entri dashboard. Be sure to fetch the JWT on the server-side of your application. The JWT expires after 60 minutes. You can use any networking library you’d like. Here’s an example usingfetch
:
4. Create the configuration object
Pass settings to the Entri modal window using a configuration object. Here’s a basic example:
const config = {
applicationId: "12345", // From the Entri dashboard
token: mySavedToken, // The "auth_token" value saved in the previous step
dnsRecords: [
{
type: "CNAME",
host: "www",
value: "m.test.com",
ttl: 300,
},
{
type: "TXT",
host: "@",
value: "sample-txt-record",
ttl: 300,
},
{
type: "MX",
host: "host",
value: "mailhost1.example.com",
priority: 10,
ttl: 300,
},
],
};
Configuration Object Notes
- MX records require a priority
For complete documentation of the configuration object, see the API Reference.