The following environment variables are used by Ackee. You can also create a .env
file in the root of the project to store all variables in one file.
MongoDB connection URI. See the MongoDB connection string spec for more detail.
ACKEE_MONGODB=mongodb://localhost:27017/ackee
or
MONGODB_URI=mongodb://localhost:27017/ackee
The port Ackee should listen on. Defaults to 3000
.
ACKEE_PORT=3000
or
PORT=3000
Username and password. Both are required to generate a new token.
ACKEE_USERNAME=username
ACKEE_PASSWORD=password
Specifies how long a generated token is valid. Defaults to 3600000
(1 day).
ACKEE_TTL=3600000
Pick a custom name for the tracking script of Ackee to avoid getting blocked by browser extensions. The default script will always be available via /tracker.js
. You custom script will be available via /custom%20name.js
. Ackee will encode your custom name to a URL encoded format. Avoid characters that can't be used in filenames.
Make sure to adjust the tracking script URL on your sites when changing this option. Sites that are using the default URL won't be affected.
ACKEE_TRACKER=custom name
Set the environment to development
to see additional details in the console and to disable caching.
NODE_ENV=development
Quick solution for setting CORS headers instead of using a reverse proxy. This is helpful if you are running Ackee on a platform that handles SSL for you.
ACKEE_ALLOW_ORIGIN=https://example.com
or
ACKEE_ALLOW_ORIGIN=https://example.com,https://one.example.com,https://two.example.com
Setting a wildcard (*
) is also supported, but not recommended. It's neither a secure solution nor does it allow Ackee to ignore your own visits. Please disable the ignoreOwnVisits
option in ackee-tracker if using a wildcard is the only option for you.
ACKEE_ALLOW_ORIGIN=*
As opposed to manually configuring CORS domains, you can also automatically add CORS Headers for domains in the domain list that have fully qualified domain names as titles. To achieve this, set:
ACKEE_AUTO_ORIGIN=true