Let's build a screenshot API

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • LocalStack

    đź’» A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline

  • Later you can use any S3 compatible storage because the code I write will still work, but for testing purposes on my local machine, I will use LocalStack:

  • hugo-quick-start

    Hugo Quick Start on Render

  • The main upside is cost-effectiveness, but managing VPS is still painful which can be solved with PaaS like Heroku, Render, or similar.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • puppeteer

    Node.js API for Chrome

  • Playwright seems to be a superior library for working with headless browsers than Puppeteer, but I will go with Puppeteer.

  • Playwright

    Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

  • Playwright seems to be a superior library for working with headless browsers than Puppeteer, but I will go with Puppeteer.

  • kamal

    Deploy web apps anywhere.

  • Or you can use [https://kamal-deploy.org/] and GitHub actions for automating at least deploys, but there are still will be issues that you will need to solve.

  • hono

    Web Framework built on Web Standards

  • Hono—a simple and fast framework for processing HTTP requests.

  • easylist

    EasyList filter subscription (EasyList, EasyPrivacy, EasyList Cookie, Fanboy's Social/Annoyances/Notifications Blocking List)

  • import { ScreenshotOptions } from "./schema"; import puppeteer, { Page } from "puppeteer"; import { PuppeteerBlocker } from "@cliqz/adblocker-puppeteer"; import fetch from "cross-fetch"; let blocker: PuppeteerBlocker | null = null; async function blockCookieBanners(page: Page) { if (!blocker) { blocker = await PuppeteerBlocker.fromLists(fetch, [ // the list of the cookie banners to block from the https://easylist.to/ website "https://secure.fanboy.co.nz/fanboy-cookiemonster.txt", ]); } await blocker.enableBlockingInPage(page); } export async function render( options: ScreenshotOptions ): Promise<{ url: string }> { const browser = await puppeteer.launch(); const page = await browser.newPage(); if (options.block_cookie_canners) { await blockCookieBanners(page); } await page.setViewport({ width: options.viewport_width, height: options.viewport_height, deviceScaleFactor: options.device_scale_factor, }); await page.goto(options.url); const encodedScreenshot = await page.screenshot({ type: "jpeg", encoding: "base64", fullPage: options.full_page, }); await browser.close(); return { url: `data:image/jpeg;base64,${encodedScreenshot}` }; }

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • coolify

    An open-source & self-hostable Heroku / Netlify / Vercel alternative.

  • Heroku and similar providers can simplify the server management issues, but you can use something much better that can combine both cost efficiency and ease of deployment—Coolify:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts