Skip to main content
In this tutorial you add a notes feature to your website where an admin can create/edit/delete notes and any user can view them. The key architectural idea: Qirtaas is the notes backend. Documents are created, listed, and deleted from the frontend over the SDK’s embed-token channel, and each user’s embed identity scopes them to their own documents. Your backend needs exactly one change, a token endpoint, and zero new tables. What you’ll build
  • Backend: one token endpoint (the only backend change).
  • Frontend: a compose page with <QirtaasEditor>, a note list driven by listDocuments(), reopen-to-edit, and delete.
Frontend samples are React; the token endpoint is tabbed Node (Express) and Python (FastAPI). Prerequisites: a qrt_sk_… API key (see the Quickstart) and npm install @qirtaas/react.

1. Backend — add the token endpoint

The editor authenticates every request with a short-lived embed token, and only the secret key holder can mint one. Gate the endpoint with your app’s own auth and pass the authenticated user’s id as external_user_id: Qirtaas auto-provisions an identity per distinct id, and that identity is what scopes each user to their own documents (creation, listing, and deletion all happen within it).
Whoever can call this endpoint can edit that identity’s documents — always gate it with your own authentication and derive external_user_id from the session, never from the request body.
That’s the entire backend. Everything below is frontend.

2. Frontend

Create the client once and share it across your code. The same getToken powers the editor and the list/delete operations:
src/qirtaas.ts

3. Frontend — the compose page

Mount <QirtaasEditor> without a documentId: the SDK lazily creates the document on the first keystroke and hands you the new id via onDocumentCreated. The editor takes care of persisting any changes.
src/ComposeNote.tsx
Use onDocumentCreated for navigation concerns (swap /notes/new for /notes/<id> so a refresh reopens the same note) and onSaveStateChange for a saved/saving badge.

4. Frontend — Notes Dashboard

listDocuments() returns the identity’s documents:
src/NoteList.tsx
Render the list with your own markup. Mount a Qirtaas embed only on the compose/read page, not per list item.

5. Frontend — reopen note

To continue an existing note, pass its id as documentId. The component mounts the editor once, so when the user switches notes, force a remount with a key:
src/EditNote.tsx
Because the embed token is minted for the same external_user_id, the owner can reopen and edit any of their documents.

6. Frontend — delete a note

That’s the whole lifecycle!

Where you are

Users can author, list, reopen, and delete rich documents, and your backend grew by one endpoint. Next:

Document reading

Show these notes read-only with the renderer.

Access control

Let other users read them, gated by your own ACL.