This guide walks you through cloning the repository, starting a local development server, and making your first request toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dadu0699/qr-code/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/qr/generate. By the end you will have a working SVG QR code saved to your machine and a clear understanding of the request/response shape.
Prerequisites
Make sure the following tools are installed before continuing.Node.js v24 or laterpnpmIf pnpm is not installed, enable it via Node.js’s built-in Corepack:
Clone & Install
Clone the repository and install all dependencies with pnpm.pnpm resolves the exact versions pinned in
pnpm-lock.yaml and links packages via a content-addressed store, keeping your node_modules lean.Start the Dev Server
Launch the Astro development server. Wrangler generates the Cloudflare Workers type declarations first, then Astro starts with hot-module replacement enabled.The server starts on port 4321. You should see output similar to:Open
http://localhost:4321 in a browser to explore the built-in web UI, or proceed to the next step to call the API directly.Make Your First Request
With the dev server running, send a A successful response returns HTTP You can also pass custom hex colors to match your brand:Valid color formats are
POST request to /api/qr/generate. The endpoint accepts a JSON body and returns an image/svg+xml response.200 with Content-Type: image/svg+xml and an SVG document in the body:When no
color object is provided, the API uses the default color scheme: dark #000000 (foreground modules) and light #FFFFFF (background). These defaults maximise compatibility with all standard QR code scanners.#RGB, #RGBA, #RRGGBB, and #RRGGBBAA. Passing any other format returns a 400 error with a descriptive JSON message.Example Request & Response
Request body shape (QRCodeRequest):
| Field | Type | Required | Description |
|---|---|---|---|
url | string | ✅ Yes | The HTTP or HTTPS URL to encode. Maximum 2 048 characters. |
color.dark | string | ❌ No | Hex color for QR modules (foreground). Defaults to #000000. |
color.light | string | ❌ No | Hex color for the background. Defaults to #FFFFFF. |