Docs
Links & QR
Short links and printable QR codes you can embed anywhere — with aggregate click counts instead of invasive tracking.
Overview
The Links & QR module provides branded short links with auto-generated SVG QR codes. Create a link with a custom slug, get a QR code instantly, and track aggregate click counts. Links support optional expiration dates — expired links return 404 automatically. Only aggregate click counts are stored; no individual visitor data, cookies, or fingerprinting.
API Endpoints
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /v1/qr/links | Bearer | List all short links with click counts |
| POST | /v1/qr/links | Bearer | Create a new short link |
| GET | /v1/qr/links/:id | Bearer | Get a single link |
| PATCH | /v1/qr/links/:id | Bearer | Update link destination or expiration |
| DELETE | /v1/qr/links/:id | Bearer | Delete a link |
| GET | /v1/public/qr/:id.svg | None | Public — get QR code as SVG image |
| GET | /r/:slug | None | Public — redirect short link and track click |
Create a Short Link
Create a branded short link with a custom slug. Optionally set a title and expiration date.
POST /v1/qr/links
Authorization: Bearer nk_live_...
{
"slug": "summer-sale",
"destinationUrl": "https://yoursite.com/summer-sale",
"title": "Summer Sale 2025",
"expiresAt": "2025-09-01T00:00:00Z"
}
// Response:
{
"id": "...",
"slug": "summer-sale",
"shortUrl": "https://nkt.link/r/summer-sale",
"qrSvgUrl": "/v1/public/qr/...svg",
"clickCount": 0
}Get QR Codes
A QR code SVG is auto-generated on link creation. Fetch it anytime via the public endpoint. The SVG scales to any size without losing quality.
GET /v1/public/qr/{linkId}.svg
// Returns: image/svg+xml
// Use directly in HTML:
<img src="https://api.nexus-kit.com/v1/public/qr/{linkId}.svg"
alt="Summer Sale QR Code"
width="200" height="200" />Redirect Flow
When someone visits your short link, the redirect endpoint handles the redirect and tracks the click.
// User visits: https://nkt.link/r/summer-sale
// Server returns: 302 Redirect → https://yoursite.com/summer-sale
// Click count is incremented atomicallyClick Tracking
Every redirect through /r/:slug increments the click count. View aggregate stats in your dashboard or via the API. Only the total count is stored — no IPs, no cookies, no individual visitor data. Export all links with click counts as CSV for reporting.
Expiration
Set an expiresAt timestamp on any link. When the current time passes the expiration, the redirect endpoint returns a 404 instead of redirecting. This is useful for time-limited campaigns, event links, or promotional QR codes.
FAQ
How do short links work?
Create a link via the API with a custom slug and destination URL. The redirect endpoint /r/:slug returns a 302 redirect and increments the click count.
Is NexusKit Links and QR free?
Yes, within fair-use limits. No monthly caps on link creation — just rate limits on the API (120 RPM).
What format are the QR codes?
SVG files generated via the qrcode library. They scale to any size without losing quality.
Can I set expiration dates?
Yes. Set an expiresAt timestamp on any link. Expired links return a 404 on redirect.
Ready to create short links?
Start free. No credit card. Create your first link in seconds.
