Skip to content

WeaverFi/cookietrack-api

Repository files navigation

CookieTrack Logo

CookieTrack API

The API that powers CookieTrack.

CodeQL Version

NodeJS TypeScript Express.js Firebase

Twitter Shield


Documentation

CookieTrack's OpenAPI documentation can be found here.


Contributing

Contribution guidelines can be found here.


Rate Limits

The API endpoint at https://api.cookietrack.io currently has a rate limit of 200 calls every 6 hours.

This is so that everyone can enjoy the API without overloading it for others.

If you'd like to host it yourself to use without restrictions, refer to the Self-Hosting section below.


Self-Hosting

This repository is already setup for Firebase hosting, but could easily be adapted to be deployed on AWS or any other cloud deployment service.

  1. Add your own API keys in functions/static/keys.json. An example file is provided.

  2. Install dependencies by navigating to the functions folder and using npm i.

  3. Deploying to Firebase can be done through npm run deploy. The script is already setup to compile from Typescript, update the routes.json file, etc.

If you wish to test endpoints locally, you have the following options in the index.ts file:

  • Test locally by setting localTesting to true and running npm start.

  • Alternatively, you could test through Firebase's emulators by setting emulatorTesting to true instead and running npm run emulator.

  • Be sure to turn off rate limiting by setting rateLimited to false!

The cookietrack-types npm package includes common typings for the API. Check out its repository here.