Introducing a new way to review your PRs.

Read the announcement

capsoftware / cap

Open source Loom alternative. Beautiful, shareable screen recordings.

View on GitHub

31 documents · Updated Nov 23, 2026

docs / web-product

Web product and collaborative workspace

The web product is the Next.js experience for turning captured content into a shared Cap. A Cap is a recorded video or screenshot that people can store in a workspace, organize into spaces and folders, view through a protected link, and discuss with time-based comments and reactions. The product also gives developers a controlled way to create, process, store, deliver, and play video through Cap Infra.

Product boundary

The web product connects capture intake, content management, playback, sharing, collaboration, plan purchase, and external client access. It serves workspace members, people who receive a share link, and developers who use the video platform. Shared policy and domain services keep these entry points consistent.

The main product surfaces are:

  • Public product site: Explains recording, editing, sharing, collaboration, plans, downloads, and licenses.
  • Workspace dashboard: Lets users manage Caps, folders, organizations, spaces, members, settings, notifications, and analytics.
  • Capture intake: Accepts browser recordings, uploads, pasted media, browser-extension recordings, screenshots, and Loom imports.
  • Share page: Provides playback, transcripts, captions, AI context, comments, reactions, downloads, and owner controls.
  • Public collection: Presents public videos and folders as a branded collection.
  • Embed player: Plays an eligible Cap inside another site or integration.
  • Cap Infra: Gives developers app-level keys, video intake, playback links, storage and usage views, credits, transcripts, webhooks, and agent setup.
  • Client and agent access: Gives mobile apps, SDK users, and approved agents controlled ways to read and manage Caps or developer media.

The main entry points are:

Entry pointProduct roleAccess shape
/Introduces the product and its recording and sharing valuePublic visitor
/pricingCompares plans and starts checkoutPublic visitor or signed-in user
/dashboard/capsShows a user's Caps and foldersSigned-in workspace member
/dashboard/spaces/[spaceId]Shows content shared with a space or organizationMember with collection access
/s/[videoId]Provides the full viewing and collaboration experiencePublic, signed-in, password, or invite access
/embed/[videoId]Provides focused playback for another page or toolThe Cap's viewing policy still applies
/c/[id]Presents a public collection of videos and foldersCollection access rules
/infraStarts the developer video platform workspaceSigned-in eligible developer
/infra/[appId]Manages one developer app and its video platform useApp owner
/dev/[playbackId]Shares a developer videoPublic playback policy
/dev/[playbackId]/embedEmbeds a developer videoPublic embed playback policy
/docs/[...slug]Presents product and developer guidancePublic visitor

For the route-level map, read Web application routes. For the service contracts behind these screens, read Web API and domain services. For the developer platform, read Developer infrastructure platform. For agent and MCP access, read Infrastructure MCP tooling.

Product entry points

Each entry point serves one stage of the same content journey. The public site explains the product and offers plan purchase. The dashboard is the control surface for owners and members. Share pages, embeds, collections, mobile clients, agents, and developer playback make a Cap useful outside the workspace.

Login supports email codes, passkeys, external identity providers, Google One Tap, and organization SSO. It preserves a safe return path so a visitor can complete sign-in and continue the product action that started the journey. Account security also lets a signed-in user change the sign-in email, manage passkeys, revoke agent keys, and sign out all devices.

The public site also keeps help and product education in the same web experience. Documentation pages resolve a slug to a rendered guide and provide page metadata for search and sharing. The same guides can be returned as Markdown for tools that need text rather than HTML. The support messenger gives a visitor or user a persistent path to an agent or the Cap team.

References: apps/…/Navbar.tsx• L12-65 apps/…/page.tsx• L1-9 apps/…/form.tsx• L262-309 apps/…/form.tsx• L760-839 apps/…/page.tsx• L14-43 apps/…/route.ts• L5-22 apps/…/MessengerWidget.tsx• L610-729

Authentication and account security

Authentication gives people several ways to enter the product while keeping account changes behind a fresh identity check. Email codes support the main web sign-in path. Passkeys provide a faster sign-in method and can also confirm identity for sensitive account actions. Google and organization identity providers cover users who do not use email codes.

Account security treats a passkey, an agent key, a desktop credential, and a web session as separate access paths that the account owner can control. Email changes require a code sent to the new address. Adding or removing a passkey and changing the sign-in email require a short-lived step-up grant, which is a temporary proof that the user recently confirmed identity. The account page reports failed credential reads instead of showing an empty list, so a load error does not hide credentials that may still need revocation.

The sign-in and account flows follow this high-level sequence:

flowchart LR
    A[Start sign-in or account action] --> B{Identity method}
    B -->|Email| C[Verify one-time code]
    B -->|Passkey| D[Verify device credential]
    B -->|Google or SSO| E[Complete provider flow]
    C --> F[Create session or step-up grant]
    D --> F
    E --> G[Create session]
    F --> H[Continue action]
    G --> H

References: apps/…/email-change.ts• L46-89 apps/…/passkeys.ts• L60-130 apps/…/VerifyIdentityDialog.tsx• L54-132 apps/…/server.ts• L91-205 apps/…/route.ts• L19-61

Billing and plan purchase

Billing connects public pricing to workspace access. A visitor or signed-in user selects a Cap Pro plan and seat count, completes payment, and then reaches the workspace through the account that owns the purchase.

The checkout journey supports monthly and yearly plans. It supports guest checkout as well as signed-in checkout, with currency chosen for the visitor's region. A completed payment does not grant access by itself. The product uses the payment result to match or create the account and then updates its plan entitlement.

This diagram shows how plan selection becomes workspace entitlement.

flowchart LR
    A[Pricing or plan request] --> B[Select plan and seats]
    B --> C[Checkout]
    C --> D{Payment state}
    D -->|Paid| E[Link or create account]
    D -->|Pending| F[Wait for confirmation]
    D -->|Failed or expired| G[Try again]
    E --> H[Enable workspace plan]
    F --> H

References: apps/…/page.tsx• L32-77 apps/…/page.tsx• L29-106 apps/…/checkout.ts• L78-255 apps/…/route.ts• L10-64 apps/…/route.ts• L12-70

Content lifecycle

The product moves content from capture or import into a library and then into a viewing or collaboration surface. Upload completion and playback readiness are separate states. Processing can continue after the user starts an upload, so the product shows progress or preparation states until stable media is available.

This diagram shows the high-level path from intake to collaboration or external playback.

flowchart LR
    A[Record, paste, upload, or import] --> B[Store and process media]
    B --> C[Personal library]
    C --> D[Folder or space]
    C --> E[Share link]
    D --> E
    E --> F[Watch and review]
    F --> G[Comments, reactions, captions, transcript, and AI context]
    E --> H[Embed or public collection]
    B --> I[Developer app video]
    I --> J[Developer share or embed]

Capture intake

Capture intake gives users several ways to bring content into Cap. A media file becomes a screenshot or a video. The dashboard can also accept pasted media and browser recordings, while Loom import brings existing share links into a personal or shared collection.

The product applies plan, organization, and upload-state checks before it creates content. It keeps transfer progress separate from server processing, so the library can distinguish an item that is uploading from one that is being prepared for playback.

Loom import supports a single link and an organization CSV flow. The CSV flow maps Loom URLs to users and optional spaces, reports each row, and supports larger migrations through a concierge or agent path. The dashboard also gives organization managers a team view of queued, active, completed, and failed imports.

References: apps/…/RecordVideoPage.tsx• L14-75 apps/…/ImportPage.tsx• L11-74 apps/…/ImportFilePage.tsx• L15-88 apps/…/ImportLoomPage.tsx• L78-120 apps/…/LoomImportStatus.tsx• L82-170 apps/…/DashboardPasteImport.tsx• L40-104 apps/…/import-loom-video.ts• L1-120

Media processing

Media processing turns a stored source into playable media, preview assets, and metadata. Standard uploads, Loom imports, and developer videos use durable work that can wait for capacity, retry temporary failures, record lasting errors, and finish with dimensions and duration.

After processing saves media metadata, the product can create a transcript and other AI context. Developer video processing adds a separate transcript flow with usage, storage, and cleanup rules. These results remain asynchronous, so the product can show a video or transcript as waiting, ready, paused, or failed.

The same Cap model covers screenshots, uploaded video, imported video, growing recordings, and developer video playback even though their source paths differ. Completion checks protect existing content when a recording source changes or remains incomplete.

References: apps/…/process-video.ts• L45-107 apps/…/process-developer-video.ts• L1-160 apps/…/developer-transcribe.ts• L1-160 apps/…/developer-video-processing.ts• L1-180 apps/…/route.ts• L1-180

Content library

The library lets a user find and manage owned Caps. It combines videos, screenshots, folders, upload placeholders, selection, deletion, movement, sharing, downloads, archiving, and view data in one workspace surface. Dashboard search provides a second way to reach Caps, spaces, navigation actions, and permitted settings.

Folders can be nested and can carry a color and public collection setting. People can move Caps or folders between personal, organization, and space locations by selection, dialog, or drag and drop. Shared collections use the same content model while adding member controls, inherited viewer rules, folders, analytics, and movement within a space or organization.

Archived Caps leave the normal library and folders without losing their links, comments, or space shares. They have a separate view for restore and bulk management, so archive is a library state rather than content deletion.

Cap cards show whether content is ready, shared, protected, archived, or still being processed. They also expose the actions that owners or permitted members can take, such as sharing, moving, downloading, editing, archiving, and deletion.

References: apps/…/caps-page-data.tsx• L134-181 apps/…/Caps.tsx• L88-169 apps/…/Caps.tsx• L289-377 apps/…/Caps.tsx• L449-469 apps/…/page.tsx• L8-14 apps/…/CapCard.tsx• L101-167 apps/…/QuickActions.tsx• L105-135 apps/…/DashboardSearch.tsx• L123-201

Share and playback

The share page is the main view for a Cap. Its server side resolves the Cap, owner, sharing locations, effective access rules, media readiness, playback source, comments, views, and optional AI data before it renders the client experience.

The viewer can watch a video or view a screenshot, then switch among playback, timeline, comments, chapters, transcript, summary, captions, and recording tools. The share URL can carry the selected view, time, comment, reply, and recording state.

Developer playback uses the same product boundary in a smaller surface. A public developer video page shows a named player, waits for upload or processing, reports paused, failed, or removed media, and supports share and embed variants. The embed variant removes workspace chrome while keeping playback controls, captions, configured options, and media state. It can report an unavailable or paused state to the containing page.

Playback chooses an allowed source for the browser. It can use processed media, a raw preview for supported cases, growing desktop segments, or a developer playback rendition. If a signed source expires, the client can refresh it without losing the current playback position.

Public links can be open to anyone or restricted to a matching organization email domain when the organization allows that choice. Free-plan Caps can also reach a monthly share-link limit. Screenshots remain viewable on the share page but are not embeddable.

References: apps/…/page.tsx• L365-479 apps/…/Share.tsx• L187-224 apps/…/ShareHeader.tsx• L153-209 apps/…/route.ts• L80-455 apps/…/DeveloperVideoPage.tsx• L140-217 apps/…/page.tsx• L18-27 apps/…/EmbedError.tsx• L6-40 apps/…/developer-video-player.ts• L1-200

Collaborative feedback

Collaboration is tied to a Cap and its playback position. Comments, replies, reactions, and recorded media comments appear beside the relevant moment or in the activity area. Signed-in viewers can add comments, reply, seek to a comment's timestamp, and delete their own comments.

The timeline groups comments by nearby moments. Desktop viewers can inspect a branch card and mobile viewers can open the same feedback in a dismissible sheet. This keeps time-based discussion usable across screen sizes without changing the comment record.

Transcripts, captions, summaries, and chapters add shared context to review. The viewer can select a caption language, request a translation, copy text, download captions, and edit the original transcript when allowed. These results can finish after the first page load, so the share view reports their status and exposes each result only when it is ready and allowed by policy.

Workspace notifications turn comments, replies, reactions, and views into a return path to the Cap. The dashboard groups notifications by type, shows unread counts, supports mark-all-as-read, and links notification settings from the panel. Signed-in mobile users can also receive push alerts for these events when their session and device token remain valid.

References: apps/…/Comments.tsx• L86-147 apps/…/Comment.tsx• L118-205 apps/…/TimelineBranchCard.tsx• L43-109 apps/…/TimelineMobileSheet.tsx• L19-70 apps/…/Transcript.tsx• L128-480 apps/…/index.tsx• L23-144 apps/…/FilterTabs.tsx• L13-95 apps/…/NotificationFooter.tsx• L7-30 apps/…/mobile-push.ts• L79-220

Video editing

Video editing gives Cap Pro owners a way to save a new playable range for a processed MP4 and restore the original source. An edit is treated as background processing, so the share page and dashboard can show that the Cap is busy rather than presenting a partial result.

The edit flow keeps an original source copy before it replaces the current result. It rejects concurrent or stale edits and can restore the Cap to its original range.

References: apps/…/save-edits.ts• L69-410 apps/…/CapCard.tsx• L183-233

Downloads

Downloads provide a controlled way to save the current or original video file. Owners and members with content access can download their permitted files. Other viewers can download only a published current file when the Cap and organization allow viewer downloads.

Download access follows the same view policy as playback. Privacy, email restriction, link access, password, processing state, share-link limits, and rate limits can all prevent a download. Large files stream through the browser rather than being loaded into a page buffer.

References: apps/…/download.ts• L29-220 apps/…/video-download-access.ts• L29-100 apps/…/video-download-permissions.ts• L12-99 apps/…/start-browser-download.ts• L1-17

Workspace model

The workspace model separates ownership from shared access. Organizations group members and shared content. Spaces provide smaller collections inside an organization, and folders give personal and shared content a tree for navigation.

Organizations and spaces

The dashboard selects an active organization and loads its members, invites, settings, spaces, notifications, and content counts. An organization-wide collection acts as a shared view without changing who owns each Cap.

Users can work with spaces they own, spaces that are public within the organization, or spaces where they are members. Space controls follow the current role. A space page lets an authorized manager add Caps, manage members, create folders, change space settings, change the shared order, publish a collection view, and inspect collection analytics.

The workspace navigation supports organization switching, search, notifications, member invitations, space links, account actions, and mobile navigation. The sidebar can collapse on desktop, while the mobile bar keeps organization switching and the main workspace destinations available on small screens. The developer surface is separate from this content hierarchy.

References: apps/…/dashboard-data.ts• L31-168 apps/…/DashboardContext.ts• L1-180 apps/…/Items.tsx• L73-142 apps/…/DashboardSearch.tsx• L157-260 apps/…/SpacesList.tsx• L82-164 apps/…/MemberAvatars.tsx• L14-86 apps/…/Desktop.tsx• L13-91 apps/…/MobileTab.tsx• L28-117 apps/…/SharedCaps.tsx• L168-232 apps/…/SpaceOrderSelect.tsx• L32-57 apps/…/MembersIndicator.tsx• L37-100

Developer app workspace

Cap Infra gives a developer app its own workspace inside the web product. The app overview brings together recent videos, upload entry, API keys, credit balance, stored minutes, video count, and current billing standing. Its navigation separates video work from account work such as usage, billing, keys, webhooks, and settings.

An app owner can upload or import videos, inspect readiness, watch media, rename or remove it, copy playback links, and prepare embed code. Settings identify the app as test or live traffic and can restrict which site origins may embed its player. Webhooks provide signed delivery of video state changes, while the usage and billing views explain stored media, delivered minutes, transcription, credit transactions, top-ups, and balance shortfalls.

The web console and public developer API share the same app scope. The console protects app ownership with the signed-in session. API and SDK access use app credentials and return app-scoped video, upload, transcript, usage, and webhook data.

References: apps/…/shell.tsx• L61-77 apps/…/page.tsx• L54-85 apps/…/video-client.tsx• L129-199 apps/…/embed-options.tsx• L18-116 apps/…/domains-section.tsx• L38-108 apps/…/webhooks-client.tsx• L124-199 apps/…/page.tsx• L66-151 apps/…/billing-view.tsx• L71-140

Directory synchronization

Directory synchronization is an organization security feature that keeps Cap membership aligned with an external SCIM directory. An entitled organization manager can connect or manage a directory from security settings, see sync health and member counts, and approve removals when a directory change would remove many members at once.

Active directory users join the organization. Users who are removed or deactivated in the directory leave the organization and can have their Cap sessions and external access credentials revoked. The process protects owners and users who still have another active directory link.

References: apps/…/page.tsx• L72-100 apps/…/DirectorySyncCard.tsx• L90-185 apps/…/directory-sync.ts• L360-671 apps/…/route.ts• L89-136

Access and policy

A Cap's effective viewing policy combines settings from the Cap, its organization, and the spaces that contain it. The policy covers privacy, link restrictions, passwords, comments, reactions, captions, transcripts, summaries, chapters, downloads, and playback state.

Organization preferences also shape new content and share presentation. Managers can set a private-by-default recording choice, Cap viewer defaults, a workspace call to action, and Pro share-page branding. Content management can move a folder and its Caps to another member while preserving the Cap's links, metadata, comments, and analytics where the transfer rules allow it.

The same policy decides whether a visitor can view media, must sign in, must enter a password, or must see a restricted result. Organization and space rules can require a viewer setting even when the Cap owner did not set it. Desktop, mobile, agent, and developer-facing reads receive content summaries only after the same ownership and policy boundary is applied.

References: apps/…/SettingsDialog.tsx• L36-184 apps/…/SharingDialog.tsx• L91-131 apps/…/DefaultVideoVisibility.tsx• L15-65 apps/…/DefaultCallToAction.tsx• L32-142 apps/…/ShareableLinkBrandColor.tsx• L36-99 apps/…/ContentManagement.tsx• L83-217 apps/…/link-access.ts• L5-52 apps/…/video-download-permissions.ts• L14-28 apps/…/page.tsx• L379-451 apps/…/developer-user-scope.ts• L1-160

Public collections

Public collections turn a space or folder into a browsable page rather than a single share link. A manager can publish the collection, copy its link, set a title and subtitle, choose a logo, add a call-to-action, and choose a list or grid layout.

The collection has its own presentation settings while its Caps still follow their content and viewing rules. Public collection links are a Pro capability and can be disabled without changing ownership of the underlying Caps. Collection setting changes are treated as small patches, so a logo update or another in-flight setting change does not replace unrelated presentation choices.

References: apps/…/page.tsx• L141-337 apps/…/CollectionShareControl.tsx• L34-154 apps/…/CollectionShareDialog.tsx• L81-286 apps/…/PublicCollectionField.tsx• L22-99 apps/…/page.tsx• L65-84 apps/…/SharedCaps.tsx• L354-386

Workspace analytics

Workspace analytics helps an organization understand how its shared Caps are used. It combines Cap creation, views, comments, and reactions with viewer breakdowns such as country, city, browser, operating system, and device.

The dashboard supports rolling and lifetime ranges. It can scope results to an organization, a space, or one Cap. View events are accepted only after the product checks that the Cap can be viewed and is not still being uploaded. The analytics view also supports selecting Caps for comparison and selecting which metrics appear in the main chart.

References: apps/…/data.ts• L27-359 apps/…/AnalyticsDashboard.tsx• L51-159 apps/…/StatsChart.tsx• L38-149 apps/…/OtherStats.tsx• L137-241 apps/…/route.ts• L51-165 apps/…/CapCardAnalytics.tsx• L15-93

Server and client composition

The web product uses Next.js server pages as the boundary for identity, access checks, data reads, metadata, and initial data. Client components own long-lived interaction such as playback, upload progress, selection, dialogs, optimistic comments, polling, captions, and view changes.

Shared application shell

The root layout supplies the document, fonts, theme, and optional product analytics. Authenticated areas add providers for auth state, sessions, billing, settings, queries, notifications, and analytics. The organization shell checks login, pending invites, and onboarding before it loads the active workspace.

The dashboard shell then supplies the desktop sidebar, mobile navigation, organization context, upload state, paste import, responsive top bar, dashboard title slot, search, notifications, and account controls. Route pages can place a title or folder path into the top bar without taking ownership of the shell layout.

The developer infrastructure shell applies an additional eligibility boundary. Signed-out users can return to login. Signed-in users outside the preview receive no product page. Eligible users enter a first-run screen or the selected app, where app-level pages provide one consistent developer workspace.

The web package provides the Next.js runtime and typed links to shared database, domain, API, storage, UI, and utility packages. It also serves API and Markdown discovery documents so external clients and agents can learn the supported interfaces.

References: apps/…/layout.tsx• L1-118 apps/…/layout.tsx• L44-138 apps/…/DashboardInner.tsx• L6-25 apps/…/TopBarTitle.tsx• L13-53 apps/…/Top.tsx• L62-264 apps/…/dashboard-data.ts• L333-630 apps/…/layout.tsx• L1-15 apps/…/page.tsx• L1-20 apps/…/infra-data.ts• L261-277 apps/…/route.ts• L5-22 apps/…/route.ts• L1-8 apps/…/next.config.mjs• L27-55

Server page composition

Server pages assemble a product view from domain data and access policy. They read the current user, load route data, resolve media and image URLs, prepare analytics and collaboration data, and pass a stable product-shaped result to a client component.

This split keeps access decisions close to the data while allowing the browser to keep local interaction state. The share page uses it to decide whether media is ready, whether early playback is safe, whether a signed source can be rendered in the initial HTML, and what the viewer may see. Cap Infra pages use the same split to check app ownership and show current videos, keys, credit balance, storage use, billing state, and webhook state.

References: apps/…/dashboard-data.ts• L333-384 apps/…/caps-page-data.tsx• L134-160 apps/…/page.tsx• L25-63 apps/…/page.tsx• L295-317 apps/…/page.tsx• L450-523 apps/…/page.tsx• L25-112 apps/…/page.tsx• L379-479 apps/…/DeveloperVideoPage.tsx• L172-189 apps/…/infra-data.ts• L218-353 apps/…/page.tsx• L15-49

Client interaction composition

Client components keep the product active while a user works. Dashboard contexts hold workspace and navigation state. Library and space views hold selection, movement, dialogs, member actions, analytics views, ordering, and upload entry points. Upload surfaces keep local progress state while server actions and workflows remain the source of truth.

The library supports page selection, select-all within a view, drag movement, archive and restore, and animated removal or return when an async archive action succeeds or fails. Folder and space views reuse the same content actions while applying their own move and management boundaries.

The share client keeps playback and review state together. It preserves optimistic comments through their server round trip, keeps media comments active while they upload, and keeps live transcript content visible while the final transcript becomes ready. Caption state spans the player and transcript view so language changes apply to both.

Cap Infra uses smaller client surfaces for uploads, live processing state, copy actions, billing controls, app navigation, embed options, and webhook management. Developer share playback keeps waiting states, removal states, and refresh behavior visible until a video becomes ready or the product reports that it cannot play.

References: apps/…/DashboardInner.tsx• L5-29 apps/…/DashboardSearch.tsx• L283-357 apps/…/index.tsx• L34-138 apps/…/Caps.tsx• L116-169 apps/…/useCapSelection.ts• L22-170 apps/…/useArchiveCaps.ts• L32-104 apps/…/CapGridItem.tsx• L21-57 apps/…/FolderVideosSection.tsx• L43-80 apps/…/SharedCaps.tsx• L203-281 apps/…/Share.tsx• L226-240 apps/…/Toolbar.tsx• L59-195 apps/…/upload-drop.tsx• L14-151 apps/…/uploads.tsx• L71-150 apps/…/auto-top-up.tsx• L30-132 apps/…/webhooks-client.tsx• L124-199 apps/…/DeveloperVideoPage.tsx• L140-217

API and processing boundary

Route handlers connect browser requests, desktop and mobile clients, developer SDKs, agent clients, storage, the media server, and billing providers to shared API and domain services. Request schemas reject malformed input before product actions run. Upload routes create content and report transfer state. Playback routes return policy-aware media. Webhooks and scheduled jobs carry trusted external state into durable content, membership, billing, storage, and developer records.

The web API serves browser and mobile product actions. Developer routes cover app setup, keys, video creation and import, uploads, playback, transcripts, usage, storage, transactions, and webhooks. The agent API exposes scoped library, viewing, feedback, processing, collection, storage, and management actions. Longer operations return an operation that the client can inspect. Discovery routes publish the API catalog, OpenAPI description, and MCP server card.

Cap Infra also exposes an MCP endpoint for agent use. It accepts the app's secret key as a bearer token rather than OAuth. Its discovery responses help an agent find the endpoint and understand that authentication model.

Mobile routes also provide email-code sign-in, account and organization settings, push-token registration, notification preferences, library, upload, Cap, analytics, and deletion flows. Push delivery is a follow-up action and does not block the main product request.

For the route map, read Web application routes. For the service map, read Web API and domain services. For developer operations and credits, read Developer infrastructure platform. For MCP actions, read Infrastructure MCP tooling.

References: apps/…/route.ts• L382-420 apps/…/route.ts• L603-675 apps/…/route.ts• L15-37 apps/…/zod-validator.ts• L1-66

Agent and MCP access

The web product supports two controlled machine access paths. Agent API keys give a user scoped access to library and management actions. MCP access lets a registered tool act for a user through an authorization flow and short-lived bearer tokens.

MCP authorization validates the client, redirect URI, resource, scope, and proof-key request before the user approves it. The product then exchanges a one-use code for access and refresh tokens. Sign-out revokes the account credentials that can issue or use these paths, so machine access follows the same account security boundary as browser access.

References: apps/…/actions.ts• L12-50 apps/…/mcp-auth.ts• L64-151 apps/…/mcp-auth.ts• L172-235 apps/…/mcp-auth.ts• L238-365 apps/…/server.ts• L123-205

Billing and payment synchronization

Billing requests can start from a public visitor, an authenticated workspace member, a mobile purchase flow, or a developer app owner. The web boundary checks that the plan, seat count, credit product, and payment details are valid, then chooses the configured checkout path.

Stripe sends payment and subscription events back to the product. The product uses those events to connect a purchase to an existing account or create the account for a guest purchase, update plan and seat entitlement, handle delayed payment, and update add-on or developer credit state. This makes the webhook the durable source for access after checkout rather than the browser redirect alone.

Developer credits support paid API use. A settled purchase adds credits once. Video creation, upload, transcript work, storage, and delivery can consume the balance. Auto top-up can add a chosen amount when the balance falls below a threshold. Cap Infra exposes the balance, transactions, storage use, delivered minutes, top-up state, and standing so a developer can understand why a request is allowed, held, or paused.

Scheduled work settles storage and delivery use, retries or continues long account sweeps, sends shortfall notices, runs due top-ups, and cleans stale transcript work. This keeps usage and access aligned even when the browser is not open.

References: apps/…/checkout.ts• L78-255 apps/…/route.ts• L469-575 apps/…/route.ts• L45-178 apps/…/auto-top-up.tsx• L114-151 apps/…/route.ts• L41-113 apps/…/route.ts• L56-129 apps/…/route.ts• L18-80

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to active organization, active space, role, or navigation state must remain aligned across the dashboard shell, member and invite controls, sidebar links, search, mobile tabs, top-bar titles, notifications, and share controls.
  • Changes to Cap or developer video summary data must preserve ownership, app scope, shared status, upload state, protected playback, transcript and caption status, download state, archive state, removal state, and share URLs.
  • Changes to media intake must keep file selection, browser recording, clipboard paste, screenshot creation, Loom import, developer upload, progress, retry cleanup, team import status, and library state in sync.
  • Changes to folders or move destinations must preserve personal, organization, and space locations. A move must remove stale selections without replacing other sharing placements.
  • Changes to archive state must preserve links, comments, space shares, folder visibility, pagination counts, selection state, restore behavior, and the distinction between hiding and deleting a Cap.
  • Changes to shared-space reads must preserve both named-space and organization-wide placements. Do not let a viewer's filtered placement list overwrite a share that the owner can preserve.
  • Changes to public collection settings must keep visibility, page settings, logo ownership, copy-link behavior, Pro gates, folder nesting, public collection rendering, and patch merging aligned.
  • Changes to link access or share limits must keep organization domain rules, owner overrides, monthly quota checks, share pages, playlist access, downloads, mobile summaries, agent reads, and developer playback aligned.
  • Changes to passkeys, email changes, Google One Tap, or SSO must preserve safe return paths, nonce or step-up checks, rate limits, provider error states, account ownership, and credential revocation behavior.
  • Changes to MCP authorization must preserve redirect URI checks, resource binding, proof-key checks, one-use codes, token rotation, account locks, and sign-out revocation.
  • Changes to viewer settings must preserve the precedence of organization, space, and Cap rules. Viewer downloads must remain no broader than viewer access.
  • Changes to captions or transcript formats must keep VTT parsing, player captions, translation state, transcript editing, copy and download output, live-to-canonical handoff, developer transcript status, cleanup, and API transcript data compatible.
  • Changes to developer app scope, keys, SDK origins, allowed embed sites, agent scopes, confirmation rules, idempotency, credits, webhooks, or discovery documents must preserve public versus secret key boundaries, rate limits, error shapes, balances, signatures, and published API descriptions.
  • Changes to the Cap Infra route or legacy developer route must preserve app selection, login return paths, eligibility checks, query parameters, app sections, embed links, and old-link redirects.
  • Changes to developer video states must keep upload claims, processing retries, playback URLs, public share states, captions, transcript work, takedown state, storage charges, delivery metering, webhook delivery, cleanup jobs, and removal behavior aligned.
  • Changes to mobile notifications must keep session-hash checks, device environment, APNs token cleanup, notification types, and view de-duplication aligned.
  • Changes to async operations must keep the operation record, idempotency replay, workflow start, result state, request ID contract, webhook event, and client polling behavior aligned.
  • Changes to plan identifiers, checkout mode, seat parsing, supported currencies, credit products, or auto top-up rules must keep public pricing, authenticated checkout, guest checkout, Stripe events, add-on entitlement, developer balance, and completion-page access aligned.
  • Changes to organization settings or branding must preserve manager checks, Pro-only settings, default recording visibility, call-to-action coverage, share-player colors, public-link override behavior, image replacement, custom domains, content-transfer safeguards, and cache revalidation.
  • Changes to the web project boundary must keep Next.js commands, shared package links, workflow tracing, generated discovery and Markdown responses, cron entry points, Cap Infra routes, MCP authentication, and development-only tooling aligned.

Important failure modes

TriggerConsequenceGuard
A Cap or developer video is still uploading or processingPlayback or download is deferredShare, mobile, agent, developer, playlist, and download paths check active upload and processing state
A public link is restricted by organization domain or share quotaAn outside viewer receives a restricted result even when the URL is validLink policy and quota checks run before media, summaries, and downloads are returned
A server-rendered playback URL expiresThe player can show an error even though another allowed source existsThe client refreshes the source and preserves playback position when possible
A passkey or email-change step-up expiresA sensitive account action stops instead of changing credentialsThe server checks the short-lived grant again before the write
A Google One Tap nonce is missing or reusedThe credential is rejected and sign-in does not completeThe web client issues a nonce and the auth callback consumes it once
An MCP client uses an invalid redirect, resource, or proof keyAuthorization is denied before a token is issuedThe authorization request is validated and the code is bound to the client and redirect
A stopped desktop recording has incomplete or abandoned segmentsEarly playback can expose incomplete media or keep reloading foreverSegment state requires a safe contiguous prefix and ends abandoned playlists
A screenshot is requested through a video playback or embed pathNo playable video source is returnedShare pages handle screenshots as images and playback routes reject unsupported source types
A viewer download bypasses view policyA viewer can save content they cannot openDownload access checks membership, privacy, email rules, passwords, link limits, and viewer download settings
A non-owner tries to move content or manage a spaceThe operation is deniedServer-side organization and space role checks protect the write
An archive update is only applied to the visible pageSome selected Caps remain in the old library state or counts become wrongArchive actions operate in bounded chunks and refresh the library and archive counts
Live and canonical transcripts finish at different timesThe transcript can briefly disappear or show stale textThe client keeps the last live result through the canonical handoff
A public collection patch races with another setting or logo updateOne change can silently replace anotherCollection updates send patches and the server merges them into stored settings
A developer request has no credit balance or the app is not in good standingCreation, upload, transcript, storage, or delivery work is rejected or heldCredit admission, billing standing, and debit checks run at the API and transaction boundary
A developer video processing job stalls or failsThe public page remains waiting or shows a failure instead of playable mediaState, retry, redrive, and purge rules separate temporary work from final failure
A developer video is taken downShare and embed surfaces must not reveal media or metadataPublic playback returns an unavailable state and the console marks the video as removed
A webhook endpoint returns repeated failures or uses an unsafe URLEvents are not delivered or the endpoint is disabledEndpoint validation, signed requests, test delivery, and failure locks protect delivery
A mobile device token has no live session or is rejected by APNsThe user receives no push alertDelivery joins tokens to live sessions and removes invalid tokens
A payment completes before the browser links the accountThe success page can appear before workspace or credit access is readyThe payment event matches or creates the account and then updates entitlement
A storage or delivery sweep reaches its time limitSome accounts remain unbilled until a later runThe job returns a cursor and starts a bounded continuation with the same authorization
A legacy developer URL is used after the console moveThe user can land on the wrong workspace or lose the selected appThe legacy route resolves the old path and redirects it to the selected Cap Infra app
An agent sends OAuth metadata to the Cap Infra MCP endpointThe client uses an unsupported authorization flowDiscovery states that the endpoint uses the app secret key as a bearer token and does not use OAuth

Key files

FileWhy to read it
apps/…/layout.tsxShows the authenticated workspace shell, active organization context, upload state, and desktop/mobile composition.
apps/…/Items.tsxShows organization switching, role-aware navigation, spaces, settings, and optional Infra entry.
apps/…/DashboardSearch.tsxShows the dashboard-wide path to Caps, screenshots, spaces, navigation, and permitted settings.
apps/…/index.tsxShows the notification panel, type filters, unread workflow, and settings link.
apps/…/caps-page-data.tsxShows how library and archived Cap data are assembled with sharing and effective rules.
apps/…/Caps.tsxShows the personal library and its selection, upload, archive, deletion, and analytics behavior.
apps/…/CapCard.tsxShows the main Cap actions for sharing, settings, moving, downloading, editing, archiving, and deletion.
apps/…/useArchiveCaps.tsShows the archive and restore state transition used by the library.
apps/…/passkeys.tsShows passkey sign-in, step-up identity checks, registration, removal, and prompt dismissal.
apps/…/email-change.tsShows the protected email-change flow and security notices.
apps/…/form.tsxShows the browser entry point for email, passkey, Google, OIDC, and organization SSO sign-in.
apps/…/mcp-auth.tsShows MCP client registration, authorization codes, token exchange, refresh, bearer checks, and revocation.
apps/…/actions.tsShows the signed-in user approval boundary for MCP clients.
apps/…/MoveItemsDialog.tsxShows how the product presents personal, organization, and space destinations for content movement.
apps/…/ImportLoomPage.tsxShows the single-link and bulk Loom import experience.
apps/…/LoomImportStatus.tsxShows organization-wide Loom import progress and failure visibility.
apps/…/page.tsxShows personal folder access, nested content, collection sharing, and shared library actions.
apps/…/page.tsxShows the server boundary for space and organization collections.
apps/…/SharedCaps.tsxShows shared collection roles, membership, folders, ordering, analytics, and content management.
apps/…/SpaceOrderSelect.tsxShows the workspace-wide choice between newest, oldest, and custom Cap order.
apps/…/CollectionShareControl.tsxShows the public collection visibility, link, logo, and presentation model.
apps/…/page.tsxShows share-page policy, initial playback, processing state, and collaboration data.
apps/…/Share.tsxShows the client state boundary for playback, review, analytics, and async results.
apps/…/ShareHeader.tsxShows owner actions, share controls, branding, downloads, and lazy interaction surfaces.
apps/…/Comments.tsxShows comments, replies, optimistic state, media comments, and time-based seeking.
apps/…/TimelineMobileSheet.tsxShows the mobile form of time-based collaborative feedback.
apps/…/route.tsShows the media boundary used by share and embed playback.
apps/…/process-video.tsShows the durable media-processing handoff and transcription queue.
apps/…/AnalyticsDashboard.tsxShows analytics scope, range selection, chart loading, and the Pro access boundary.
apps/…/StatsChart.tsxShows the selectable engagement metrics and time-series view.
apps/…/shell.tsxShows Cap Infra app selection and the separation of video and account sections.
apps/…/page.tsxShows the developer app overview with video status, playback links, keys, credits, storage, and billing standing.
apps/…/video-client.tsxShows developer video viewing, readiness, rename, removal, and playback links.
apps/…/embed-options.tsxShows the product-level choices for developer embed code.
apps/…/domains-section.tsxShows how an app owner controls the sites that may embed the player.
apps/…/billing-view.tsxShows developer balance, rates, prepaid credits, and the link to usage and billing state.
apps/…/page.tsxShows stored, delivered, transcription, and time-based usage views.
apps/…/webhooks-client.tsxShows endpoint setup, signed secret handling, tests, and delivery failure state.
apps/…/route.tsShows the signed-in Cap Infra upload boundary.
apps/…/app.tsShows the public developer API groups for videos, uploads, transcripts, usage, transactions, and webhooks.
apps/…/videos.tsShows app-scoped video creation, import, listing, playback data, and removal.
apps/…/uploads.tsShows API upload tokens and the handoff to the upload service.
apps/…/webhooks.tsShows the public webhook management contract.
apps/…/route.tsShows the Cap Infra MCP transport boundary.
apps/…/route.tsShows how external pages discover developer video embed metadata.
apps/…/route.tsShows bounded storage billing, shortfall handling, auto top-up, and continuation work.
apps/…/route.tsShows how delivered playback use becomes billable usage.
apps/…/route.tsShows transcript expiry, stale upload cleanup, and caption reconciliation.
apps/…/route.tsShows the machine-readable Markdown form of public documentation.
apps/…/layout.tsxShows the shared Next.js runtime and product-wide shell boundary.