Récit account
A Récit account is optional. Writing, building, presenting, exporting, driving a deck over local Wi-Fi, and running AI jobs with your own API key all work without an account and without a server.
The hosted service is not online yet. Account commands and backend routes are outside the 1.0 contract (Stability).
What the account opens
Signing in only opens online services on top of the local tools:
- Account sign-in, sessions, and personal tokens — available in
@recit/cli(recit login,recit whoami,recit logout) and in the private@recit/apiHTTP service (GitHub, Google, and ProConnect OAuth 2.0 / OpenID Connect with PKCE, email and password, RFC 8628 device authorization, central connection for product sites, session listing and revocation, andrct_personal access tokens). The browser pages are available in the private account application (apps/account, built on the application mode of the site framework): sign-in, sign-up, forgotten password, email verification, device confirmation (/device), and one settings page (profile, sessions, sign-in methods, personal tokens, remote rooms, the name and logo of the organizations you own or administer, your data). The name and the logo change throughPATCH /, for an owner or an admin only; the logo is anv1/ organizations/: organizationId httpsaddress of an image, emptied to remove it. An owner also deletes an organization there, its name retyped, throughDELETE /; a subscription in progress, an invoice, a paid order or a project billed through Stripe keeps it, and every reason is listed. The same page shows the journal of each organization you own or administer (v1/ organizations/: organizationId GET /): what changed and who changed it, from its members to its projects, collections and sites, each action in words in English or French. Its public address is planned.v1/ organizations/: organizationId/ activity - Authenticated site collections — available in
@recit/(data- store/ client writeDocumentanddeleteDocument) and@recit/apifor organization members and invited site managers (see Published collections). - AI through Récit's server — planned on
@recit/api(onlyGET /, the use of the account's quota, is available): server-hosted AI jobs with per-account quotas so prompts and provider keys stay on the server.v1/ ai/ quota serverProvider({ url, token })from@recit/aiandcreateAiServerfrom@recit/are available for plugin authors running their own server.ai/ server - Licenses and paid plugins — partly available.
@recit/apichecks organization product entitlements (GET /) and lists the licences of an account (v1/ products/: productId/ organizations/: organizationId/ access GET /), both available. One licence is read byv1/ licenses GET /(the whole product) andv1/ licenses/: productId GET /(one plugin of it),v1/ licenses/: productId/: resourceId 404when the account holds none: the private registry of a paid plugin asks it before serving the archive (Publishing a plugin), available. Récit Studio reads that list with its session for a feature that has a price, and keeps the feature open when it cannot read it (no account, the server out of reach, a refused session); today no feature of Studio has a price. Payment through Stripe is available in@recit/api: an owner or an admin opens the payment page of an offer its product declares (POST /,v1/ organizations/: organizationId/ billing/ checkout 503when the server has no Stripe key), and Stripe's signed webhook (POST /) grants the entitlement on payment and closes it at the end of a subscription, each event applied once. Selling an offer is planned, and payment never blocks local builds or offline work.v1/ billing/ stripe/ webhook - Phone remote outside the local network — available in
@recit/api, as a preview: a hosted WebSocket relay (/v1/relay) so a signed-in presenter pairs a phone over the Internet with a QR code (the phone needs no account). A room is opened from Récit Studio or from the settings page of the account, which shows its keys once, lists the open rooms and closes them (GET,POST /,v1/ relay/ rooms DELETE /,v1/ relay/ rooms/: roomId 404for anyone but its owner). Récit Remote joins the room by the QR code; a phone without it lands on the account's/remotepage, which says how to open the code. Single-use ticket URLs (getTicket) and jittered exponential backoff (relayReconnectDelay) in@recit/deck'sPresentationPeerMessengerserve both. - Synchronization, real-time collaboration, and private decks — planned only if a concrete need appears later, with no scheduled implementation. Syncing stories across machines uses your own tools (such as git or a synced folder), and static sites can add a browser password modal without a server (Protect a site with a password).
What works without an account
You never need an account to use Récit locally, and no feature breaks when the server is down:
- Write, build, and present stories in Markdown or typed JSON from the CLI (
recit init,recit dev,recit build,recit validate) or Récit Studio. A project is a plain folder on disk. - Export stories to PDF, standalone HTML, PowerPoint, or images (
recit export), and render motion films or webtoon episodes to MP4 (recit render). - Control a deck on the same Wi-Fi network with
recit dev --or Studio's local relay (Smartphone remote).remote - Run AI jobs with your own key (
anthropic,openai, orgemini) directly from your machine to the provider (AI jobs). - Read published collections from static
/collections/files; when a server is configured and unreachable,<name>.json @recit/falls back to those static files (Published collections).data- store/ client
Signing in from the command line
recit login, recit whoami, and recit logout are loaded on demand so no other CLI command
imports account code or reads a token. See CLI for their options.
Bash
recit loginstarts an RFC 8628 device authorization flow (POST /withauth/ device/ code client_). It prints the verification URL and a shortid: "recit- cli" XXXX-XXXXcode without opening a browser, then pollsPOST /everyauth/ device/ token 5seconds (slow_downadds5seconds; the code expires after10minutes). Once approved, the session token is written tocredentials.jsonin your Récit config folder ($XDG_,CONFIG_ HOME/ recit ~/., orconfig/ recit %APPDATA%\reciton Windows) with0700folder and0600file permissions on POSIX systems. This session is of kindcli: it can read your account and your content, but it cannot create personal access tokens, list or revoke devices and sessions, link a sign-in provider, or delete the account (403); do these from the browser. The API routesGET /,v1/ device POST /, andv1/ device/ approve POST /are available; the browser confirmation page atv1/ device/ deny /deviceis planned.recit whoamiqueriesGET /v1/meand prints the signed-in user and where the token came from (RECIT_TOKENorcredentials.json). Pass--jsonfor machine-readable output.recit logoutrevokes the saved session on the server (POST /) when reachable and deletes its entry fromauth/ logout credentials.json, even offline. It never revokes or clearsRECIT_TOKEN.RECIT_TOKENsets a bearer token in the environment — such as anrct_personal access token in CI — and takes precedence overcredentials.json.RECIT_pointsAPI_ URL recit login,recit logout, andrecit whoamiat another Récit service URL (--api-urloverrides it).https://is required except onlocalhost,127.0.0.1, and[::1]; URLs carrying credentials, a query string, or a fragment are refused.
Central connection
Product sites served on separate domains do not share cookies with the central account host.
Instead, a product site obtains its own session through a PKCE (S256) authorization-code exchange
on @recit/api (Cache-; GET / is rate-limited to 60 requests per
15 minutes per client IP, and POST / is rate-limited per
(product, client IP) pair to 600 requests per minute and 60 invalid_ failures per 15
minutes, and per client IP to 300 invalid_ failures per 15 minutes):
- Browser redirect (
GET /). The product site redirects the browser toauth/ connect /auth/(connect? product= <id>& redirect_ uri= <url>& state= <state>& code_ challenge= <digest>& code_ challenge_ method= S256 stateis1to512printable ASCII characters without spaces).productmust be an active registered product andredirect_urimust behttps://on one of that product's declared domains, with no port, credentials, query string, or fragment; any invalid parameter or untrusted<its domain>/ auth/ callback redirect_urireturns400({ "error":) in JSON and never redirects."invalid_ request" } - One-time callback (
302,Referrer-). Only an activePolicy: no- referrer auth_sessioncookie of kindwebwhose sign-in method is allowed for the product counts as signed in (cliorproductcookies andAuthorization:headers count as unsigned-in). Without one, it sends the browser to the sign-in page of the account (Bearer /connecton the account application, with the same query), which signs the person in and comes back to/auth/withconnect prompt=none. Withprompt=none, or when the session was opened by a method outside the product'ssignInlist,/auth/issues no code and redirects toconnect https://; a product that never wants the sign-in page sends<its domain>/ auth/ callback? error= login_ required& state= <state> prompt=noneitself. With one, it stores only the SHA-256 digest of a one-time code valid for60seconds and redirects tohttps://so no session token ever appears in a URL.<its domain>/ auth/ callback? code= <code>& state= <state> - Server-to-server exchange (
POST /). The product's server postsauth/ connect/ token { "product", "code", "code_(no cookie read, no CORS headers) to consume the code once and receiveverifier", "redirect_ uri" } 200({ "token", "expiresAt", "userId" }) for an opaque session of kindproductbound to that product (400withinvalid_on a malformed body, orrequest invalid_if the code is unknown, expired, already used, or fails PKCE verification).grant - Rotation (
POST /). A product that keeps its session on the user's machine, such as Récit Studio, sends it asauth/ connect/ refresh Authorization:(no body, no cookie) before it expires and receivesBearer <token> 200({ "token", "expiresAt", "userId" }): a new session of the same product and family, valid for another30days, while the presented token stops working. A web session, an unknown or expired token answers401; a token presented again after its rotation is treated as stolen and revokes every session of its family. The route is rate-limited per client IP (30per minute).
- Allowed sign-in methods (
signIn). A product'ssignInlist ("github","google","password","proconnect") chooses the methods that open a session on that product, not only what its sign-in screen displays. Centralwebsessions record the method that opened them (signInMethod), and/auth/redirects withconnect error=without issuing a code whenever that method is absent from the product'slogin_ required signInlist (sessions created without a recordedsignInMethodstill pass; the password sign-up, sign-in, and forgot-password routes also return404when given aproductwhosesignInlist omits"password"). ProConnect — the identity provider for public-sector agents — is offered only by a product that declares"proconnect"insignIn(the default list is"github","google", and"password"). A Récit account that already has that email address is never linked silently: sign in first, then link ProConnect from the account page. - Scope of a
productsession. A session is valid for every product of the account: aproductsession opened by one product calls the routes of any product (/v1/, whateverproducts/: productId/ organizations/: organizationId/ … :productId), with the same organization and entitlement checks as a web session (404outside them). It also reads the signed-in account (GET /v1/me), signs itself out (POST /) and calls the routes open to every session (licences, render jobs, relay rooms, the AI quota and jobs). The account's own routes —auth/ logout PATCH /v1/me,DELETE /, the export, organization routes outsidev1/ me /v1/, sessions, personal tokens, devices, and OAuth linking — refuse aproducts/: productId/ … productsession with403({ "error":). When a product is deactivated (absent or no longer"forbidden" } activeincore.), itsproducts productsessions cease to be valid:requireSessionrejects them with401like an invalid session, including onGET /v1/me, whilewebandclisessions are unaffected. - Signing out (
POST /). Signing out with aauth/ logout productsession revokes only that session family and clearsauth_session. Signing out with aweborclisession revokes that session family and every non-revokedproductsession of the user in the same transaction (recordingdetails:on the{ productSessionsRevoked } sign_outaudit entry).
Sessions and personal tokens
The settings page of the account application lists and revokes both; @recit/api exposes the HTTP
routes below.
Sessions
- Opaque tokens. A session token is 32 random bytes encoded in hexadecimal, never a JWT.
PostgreSQL stores only its SHA-256 hex digest (
tokenHash). Sessions expire after 30 days by default. - Transport and CSRF check. Requests authenticate with the
auth_sessioncookie (HttpOnly; Secure; SameSite=) orLax; Path=/ Authorization:. State-changing cookie requests (Bearer <token> POST,PUT,PATCH,DELETE) require anOriginheader matching the configured application origin (403otherwise). - Revocation. An expired or revoked token gets
401.GET /lists active sessions (markingv1/ sessions current:and omittingtrue tokenHash),DELETE /revokes a session family (v1/ sessions/: id 404when unknown, already revoked, or owned by another user), andPOST /revokes the caller's session family and clearsauth/ logout auth_session. - Rotation. A product session rotates through
POST /(Central connection): the old token gives a new one of the same family, and an already-rotated token that comes back revokes the whole family (auth/ connect/ refresh 401). A web session does not rotate; it expires or is revoked.
Personal tokens
- Prefix and one-time display. Personal access tokens start with
rct_followed by 32 random hex-encoded bytes.POST /(v1/ tokens 201,Cache-) returns the rawControl: no- store rct_…token once and stores only its SHA-256 digest (tokenHash). - Name, scopes, and 365-day cap. Creating a token requires a non-empty
name(at most 100 characters), 1 to 32 uniquescopesmatching^[a-(up to 64 characters each), and a futurez][a- z0- 9_ ]*(: [a- z][a- z0- 9_ ]*)*$ expiresAttimestamp at most 365 days ahead. The account page offers five scopes (PERSONAL_ofTOKEN_ SCOPES @recit/) and checks the first by default:platform- api/ shared account:read, the profile thatrecit whoamireads,licenses:, the licences of the account, for a CI job that installs a paid plugin,read agents:, the token of the agents' machine, which reports its agents and takes their orders, for an administrator only,report render:write, to queue the render jobs of the connector, andai:run, to run the AI jobs of the service, counted in your quota and billable to an organization. - Listing, revocation, and scope boundaries.
GET /lists active tokens (v1/ tokens id,name,scopes,expiresAt,lastUsedAt,createdAt, nevertokenortokenHash) andDELETE /revokes one immediately (v1/ tokens/: tokenId 204, or404when unknown, already revoked, or owned by another user). Some routes of@recit/apiacceptAuthorization::Bearer rct_ … GET /v1/meandGET /with any scope, sov1/ ai/ quota recit whoamiworks in CI,GET /only withv1/ licenses licenses:andread /v1/only withrender/ jobs render:writeandPOST /only withv1/ jobs/ <job> ai:run(401otherwise). Every other authenticated route (organizations, sites, the management of forms) requires a session and answers401to anrct_token. Two kinds of route stand apart: the public ones need no token at all (/healthz,/auth/*, reading a public collection and its/events,POSTof a structure counter,POST /), and the pilot routes of collections that write or list a structure's data take that structure's own token, not anv1/ forms/: resourceId rct_one. - Renders. The account page lists the render jobs of the connector under « Renders »
(
GET /, the most recent first): each with its format and file, its state (waiting, rendering, ready or failed), when it was sent, and the size of its file or why it failed; the file itself is fetched by the tool that asked for it.v1/ render/ jobs
Your data
Self-service export and erasure are available: the routes of @recit/api, and the « Your data »
section of the account page that calls them:
- Export (
GET /). Requires anv1/ me/ export auth_sessioncookie (rejectsBearertokens with401) and is rate-limited per client IP (10requests per hour by default). Downloads a JSON attachment (recit-,account- export.json format:,"recit- account- export" version: 1,Cache-) gathering personal data acrossControl: no- store core(profile, organization memberships, linked OAuth providers, roles, sessions, personal token metadata, devices, invitations, contacts, audit entries) and every mounted module that holds some, each under its id indata.sources:ai(the AI jobs of the account, never their text),collections(site manager grants and the invitations received),forms(the form submissions whoseemailfield is the account's address),mail(the mail subscriptions of that address),relay(the open rooms of the remote relay),render(the most recent render jobs, without the story of a job still waiting) andsites(the orders placed with that address on a Récit Sites shop, never Stripe identifiers) — never password hashes or token digests. - Account deletion (
DELETE /). Requires anv1/ me auth_sessioncookie, a matchingOriginheader, and{ "confirm":matching the account's email ("<email>" } 400 confirmation_otherwise). In a single transaction, it deletes sole-member organizations owned by the caller (returningrequired 409 sole_if the caller is the sole active owner of a multi-member organization), deletes sessions, personal tokens, device codes, devices, memberships, OAuth links, roles, verifications, and invitations, anonymizes the user record, pseudonymizes its audit entries (they keep the now anonymous user id, so an organization's activity shows "Deleted User"; the IP is truncated to its /24 or /48, the user agent is removed, and the details keep only identifiers and closed values, never free text), erases the personal data of each module:owner ai(deletes the AI jobs of the account),collections(deletes the site manager invitations received, deletes or clears those it sent, deletes its manager grants and clears it from the grants it gave),forms(deletes the form submissions whoseemailfield is the account's address),mail(deletes the mail subscriptions of that address),relay(deletes the rooms of the remote relay),render(deletes the render jobs) andsites(anonymizes the orders placed with that address), and clearsauth_session(204). - Story content. Decks and stories stay in your local folders. The account service keeps the JSON of a story you send to render only while its job waits or runs, then clears it.