v0.1.0 · TypeScript · MIT
QRQuick TypeScript SDK
One zero-dependency file. Works in Node 18+ and modern browsers. Typed end-to-end with the same shape as our REST API.
Install
# Option 1 — drop the file in directly
curl -O https://qrquick.in/sdk/qrquick.ts
# Option 2 — copy from your dashboard (Admin → API → Download SDK)No transpiler, no bundler. Drop the file in your project, point your imports at it.
Quick start
import { QRQuick } from './qrquick';
const q = new QRQuick({ apiKey: process.env.QRQUICK_API_KEY! });
// Create a QR
const qr = await q.createQr({
name: 'Counter — Main Branch',
destinationUrl: 'https://menu.example.com/main',
tags: ['restaurant', 'counter'],
});
console.log(qr.shortCode); // e.g. 'Xy42aB'
console.log(q.renderUrl(qr.shortCode!));// PNG URL — embed in <img>
// Update destination later (dynamic QR)
await q.updateDestination(qr.id, 'https://menu.example.com/main-v2');
// Bulk create
const r = await q.bulkCreate([
{ name: 'Table 1', destinationUrl: 'https://menu.example.com/t1' },
{ name: 'Table 2', destinationUrl: 'https://menu.example.com/t2' },
]);
console.log(`Created ${r.created}, skipped ${r.skipped}`);
// Plan usage
const u = await q.usage();
u.meters.forEach(m => console.log(`${m.feature}: ${m.used}/${m.limit}`));Use it in React
'use client';
import { useState } from 'react';
import { QRQuick } from '@/lib/qrquick';
const q = new QRQuick({ apiKey: process.env.NEXT_PUBLIC_QRQUICK_KEY! });
export function CreateQrButton() {
const [url, setUrl] = useState('');
const [created, setCreated] = useState<string | null>(null);
return (
<div>
<input value={url} onChange={e => setUrl(e.target.value)} placeholder="https://…" />
<button onClick={async () => {
const qr = await q.createQr({ name: 'From React', destinationUrl: url });
setCreated(qr.shortCode);
}}>Make QR</button>
{created && <img src={q.renderUrl(created)} width={200} height={200} />}
</div>
);
}For server components you'll want the key in process.env.QRQUICK_API_KEY (no NEXT_PUBLIC_ prefix) so it never reaches the browser.
What's in the box
- •
createQr/listQrs/getQr/updateDestination/archive - •
bulkCreate— up to 200 QRs per call - •
renderUrl— public PNG/SVG/PDF URLs for<img>tags - •
usage— current plan + meters - •
cohorts— retention triangle - •
search— ⌘K-style cross-search - • Workspace ID auto-resolution (uses your first workspace unless
useWorkspace()called) - • Typed
QRQuickErrorwith status + code + requestId
Need a real npm package?
We're publishing to npm as @qrquick/sdk once we hit our first 50 paying integrations. Email dev@qrquick.in if you'd like an early invite.