This package holds a Lambda function responsible for collecting article analytics.
After cloning the repo, install the dependencies with NPM:
npm install
Rename .env.template
and set the necessary environment variables.
Dev.to analytics retrieves all articles in an organization. Then, it retrieves the views of the articles from the previous day. If DEBUG
is set to false
or testing
is not passed in the event in AWS or is set to false
, the views will be recorded in Segment.
To test the script locally, run:
npm run test
During testing, the script will only retrieve the analytics from Dev.to and logs them into the terminal. No data will actually be pushed into Segment.