next: Used for exposing serverless functions that do all the job.@atproto/api: Official Bluesky (ATProtocol) API client.- Vercel: Used for hosting the project, running the serverless functions and running the cron jobs.
To run this project, you need to set the following environment variables:
BLUESKY_USERNAME: Your Bluesky usernameBLUESKY_PASSWORD: Your Bluesky passwordCRON_SECRET: A secret key used to authenticate requests (optional - production usage only)
It's recommended to do so by creating a .env.local file in the root of the project by duplicating the .env file and setting the environment variables.
Run the development server:
yarn devThen you can start sending requests to the API.
This project exposes the following routes:
GET /api/check: Check for new mentions and reply them with the requested screenshot.GET /api/print?uri={{POST_URI}}: Generates a screenshot of a post.
- The image generation uses the
next/ogpackage that transforms HTML into a PNG image. It extends the funcionality ofsatori, which transforms HTML into SVG. It is limited in certain ways and does not support all HTML tags and CSS styles. See docs. - There is no realtime checks for new mentions. The API is called every minute and checks for new mentions (see vercel.json) by using Vercel Cron Jobs.
- Bluesky API does not expose the users' timezones, so the dates are displayed with the local timezone (usually it's UTC in the production environment).
MIT © Davi Coelho