Lioncat2002 / mercury-tracker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mercury-tracker

An email tracker written in typescript

Installation:

Install the dependencies with npm install
Create a .env in the root of the project with the followinf entries

PORT=3000
REDIS_HOST="REDIS HOST NAME"
REDIS_PASS="REDIS PASSWORD"

Run the server with npm run dev
However to using with an email you will need to host it somewhere like fly.io
You can also run suing the provided Dockerfile

Usage:

To use it, add an img tag to your email as an html element Eg:

<img src='https://mercury-email-tracker.fly.dev/event?userEmail=receiveremail@example.com' alt='Pixel'>

When then user opens the email, it will be logged at the /metrics endpoint

Endpoints:

GET /events?userEmail=receiveremail@example.com
Fetches the image to be rendered by the img tag and adds the EmailOpenEvent with the receiver email and their data into the job queue

GET /metrics
Fetches the metrics of last 10 minutes along with number of Opens per OS and device

Public Endpoint:

https://mercury-email-tracker.fly.dev/

About


Languages

Language:TypeScript 91.2%Language:Dockerfile 5.7%Language:HTML 3.1%