Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Add docs for QR code API

Steven Teyca0e2f26087c
diff --git a/apps/docs/api-reference/endpoint/qr.mdx b/apps/docs/api-reference/endpoint/qr.mdx
new file mode 100644
index 0000000000..49bd1ae686
--- /dev/null
+++ b/apps/docs/api-reference/endpoint/qr.mdx
@@ -0,0 +1,4 @@
+---
+openapi: get /qr
+description: Retrieve a QR code for a link.
+---
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index 8c0ed0b898..99cc74ef04 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -87,6 +87,10 @@
"api-reference/endpoint/bulk-create-links"
]
},
+ {
+ "group": "QR Codes",
+ "pages": ["api-reference/endpoint/qr"]
+ },
{
"group": "Projects",
"pages": [
diff --git a/apps/web/app/api/route.ts b/apps/web/app/api/route.ts
index b0fdf09a2c..3a37a76d98 100644
--- a/apps/web/app/api/route.ts
+++ b/apps/web/app/api/route.ts
@@ -425,6 +425,102 @@ export function GET(): NextResponse<OpenAPIV3.Document> {
},
},
},
+ "/qr": {
+ get: {
+ description: "Retrieve a QR code for a link.",
+ operationId: "getQRCode",
+ summary: "Retrieve a QR code",
+ parameters: [
+ {
+ name: "url",
+ description:
+ "The URL to generate a QR code for. Defaults to `https://dub.co` if not provided.",
+ in: "query",
+ required: true,
+ schema: {
+ description:
+ "The URL to generate a QR code for. Defaults to `https://dub.co` if not provided.",
+ type: "string",
+ },
+ },
+ {
+ name: "size",
+ description:
+ "The size of the QR code in pixels. Defaults to `600` if not provided.",
+ in: "query",
+ required: false,
+ schema: {
+ description:
+ "The size of the QR code in pixels. Defaults to `600` if not provided.",
+ type: "number",
+ },
+ },
+ {
+ name: "level",
+ description:
+ "The level of error correction to use for the QR code. Defaults to `L` if not provided.",
+ in: "query",
+ required: false,
+ schema: {
+ description:
+ "The level of error correction to use for the QR code. Defaults to `L` if not provided.",
+ type: "string",
+ enum: ["L", "M", "Q", "H"],
+ },
+ },
+ {
+ name: "fgColor",
+ description:
+ "The foreground color of the QR code in hex format. Defaults to `#000000` if not provided.",
+ in: "query",
+ required: false,
+ schema: {
+ description:
+ "The foreground color of the QR code in hex format. Defaults to `#000000` if not provided.",
+ type: "string",
+ },
+ },
+ {
+ name: "bgColor",
+ description:
+ "The background color of the QR code in hex format. Defaults to `#ffffff` if not provided.",
+ in: "query",
+ required: false,
+ schema: {
+ description:
+ "The background color of the QR code in hex format. Defaults to `#ffffff` if not provided.",
+ type: "string",
+ },
+ },
+ {
+ name: "includeMargin",
+ description:
+ "Whether to include a margin around the QR code. Defaults to `false` if not provided.",
+ in: "query",
+ required: false,
+ schema: {
+ description:
+ "Whether to include a margin around the QR code. Defaults to `false` if not provided.",
+ type: "boolean",
+ enum: [true, false],
+ },
+ },
+ ],
+ responses: {
+ "200": {
+ description: "The QR code",
+ content: {
+ "image/png": {
+ schema: {
+ type: "string",
+ format: "binary",
+ },
+ },
+ },
+ },
+ },
+ },
+ },
"/projects": {
get: {
description:
diff --git a/packages/ui/package.json b/packages/ui/package.json
index ee4b6d23ec..0c71a0890b 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,7 +1,7 @@
{
"name": "@dub/ui",
"description": "UI components for Dub.co",
- "version": "0.0.43",
+ "version": "0.0.44",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
diff --git a/packages/ui/src/content.ts b/packages/ui/src/content.ts
index d2649c2f9f..5e3a740bdf 100644
--- a/packages/ui/src/content.ts
+++ b/packages/ui/src/content.ts
@@ -14,7 +14,7 @@ export const FEATURES_LIST = [
slug: "features/branded-links",
},
{
- title: "Free QR Code Generator",
+ title: "Gorgeous QR codes for your links",
shortTitle: "QR Codes",
icon: QrCode,
slug: "features/qr-codes",
diff --git a/packages/utils/package.json b/packages/utils/package.json
index 0970d5e457..612818000f 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,7 +1,7 @@
{
"name": "@dub/utils",
"description": "Utility functions and constants for Dub.co",
- "version": "0.0.27",
+ "version": "0.0.28",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
diff --git a/packages/utils/src/constants/index.ts b/packages/utils/src/constants/index.ts
index 36b810c8a9..0eed71df7e 100644
--- a/packages/utils/src/constants/index.ts
+++ b/packages/utils/src/constants/index.ts
@@ -185,7 +185,7 @@ export const ALL_TOOLS = [
{ name: "Amazon Link Shortener", slug: "amazon-link-shortener" },
{ name: "Spotify Link Shortener", slug: "spotify-link-shortener" },
{ name: "Metatags API", slug: "metatags" },
- { name: "QR Code Generator", slug: "qr-code" },
+ { name: "QR Code API", slug: "qr-code" },
{ name: "Link Inspector", slug: "inspector" },
];