Skip to content

Getting started

Terminal window
pnpm add @qratilabs/qrati-sdk

Works the same with npm install or yarn add.

Uploads require an org-scoped API key. There’s no self-serve key management yet — ask a Qrati admin to issue one for your organization, and to add your site’s domain to your organization’s allowed origins (the same allowlist qrati-connect-ts already uses).

import { createQrati } from '@qratilabs/qrati-sdk';
const qrati = createQrati(API_KEY, {
uid: currentUser.id, // your app's own user identifier
fname: currentUser.firstName,
lname: currentUser.lastName,
});

uid/fname/lname identify the person acting through your UI — see Identity model for how this maps to a real, ownership-checkable user on the Qrati side.

const { contentId } = await qrati.upload({
eventId: 'evt_123',
file, // a File from an <input type="file"> or drop zone
onProgress: ({ percent }) => console.log(`${percent}%`),
});

upload() handles the full direct-to-S3 flow — requesting a presigned URL, uploading the bytes with progress, and confirming completion — behind one await. See Uploads for retry/error handling and the full parameter list, or the API Reference for exact types.

The snippet above is browser code, but nothing here is browser-only — the same createQrati() call works from a Node backend too. See Browser & server for what differs (progress granularity, the domain-allowlist check) and a server-side example.

Uploads are the first piece of Qrati Connect’s surface the SDK covers headlessly — gallery browsing, curation, and the rest are on the way. See the Roadmap for what’s next.