Skip to content

Rework the SDK guide: example app, localhost development, generated API reference - #100

Merged
callumalpass merged 1 commit into
mainfrom
docs/sdk-guide-overhaul
Nov 10, 2026
Merged

callumalpass merged 1 commit into
mainfrom
docs/sdk-guide-overhaul

Conversation

@callumalpass

@callumalpass callumalpass commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reworks the SDK guide so an outside developer can go from an empty folder to a deployed, signed-in app.

Developing on http://localhost needs an @mdbase-dev/sdk release that contains mdbase-dev/mdbase-connect#1381; the tutorial says so. After that release: bump the SDK pin in examples/worklog/package.json, run npm install there, run pnpm build:sdk-api, and replace "a release after 0.1.0-beta.168" in the tutorial with the version.

What changes

  • A complete example app. examples/worklog/ is a small Vite + React app (a type pack, a manifest script, sign-in, live queries, writes, work before connecting). The tutorial at /sdk/connect-quickstart/ is now "Build an app" and imports its code blocks from those files, so the page cannot drift from code that builds.
  • Develop on localhost (/sdk/local-development/): what is accepted, the development manifest, what the user sees on the approval screen, what the redirect URI is for, and a table of common problems.
  • The parts of the SDK that had no page: Sign-in and collections (/sdk/lifecycle/: phases, addCollection, reauthorize, requestAccess, setup, sign-out, problems, sign-in outside a popup), Work before connecting (/sdk/unsynced/), React (/sdk/react/), UI components (/sdk/ui/), Developer kit (/sdk/connect-dev/).
  • The overview says why to build on mdbase, how an app is published (no review or registration), what beta stability means, and where to get help.
  • API reference generated from the types. scripts/build-sdk-api.mjs reads the SDK's declarations with the TypeScript compiler and writes src/data/sdk-api.json (531 exports, 15 error codes). The page renders that file. pnpm check:sdk-api fails if it is out of date.
  • Sidebar order: Start, Build, Packages, Reference.
  • CI installs, type-checks and builds the example and runs pnpm check:sdk-api.
  • Inline code in docs articles may now wrap inside a long word, which removes a horizontal scroll on the manifest page at phone width.

Decisions to review

  • The example lives in this repository so the docs can import it. It is not published as its own repository.
  • The overview says there is no directory of outside apps yet and invites developers to email about a listing.
  • AppSwitcher is documented as listing only mdbase's own three apps.
  • src/data/sdk-api.json is committed, so the site build does not need the example installed.

Checks

  • pnpm check: 0 errors
  • pnpm build: 66 pages; pnpm index:site; pnpm check:links: no broken local links
  • node --test scripts/*.test.mjs: 26 pass
  • pnpm check:sdk-api: current
  • examples/worklog: npm run check and npm run build pass
  • No horizontal overflow at 390px on any SDK page

Not checked: pnpm import:spec needs a sibling mdbase-spec build that the worktree does not have. Sign-in from http://localhost against production cannot be exercised until the server change is deployed and an SDK is published; the example was run locally in the unsynced phase and against the SDK's own checks.

…a generated API reference

Add a Worklog example app under examples/worklog and rewrite the tutorial
around it. New pages cover developing on localhost, sign-in and collections,
work before connecting, React, the UI components and the developer kit. The
overview now says why to build on mdbase, how an app is published, and where
to ask for help. The API reference is generated from the SDK's type
declarations, and CI checks the example builds and the reference is current.
@callumalpass

Copy link
Copy Markdown
Contributor Author

The server and SDK change this guide depends on: mdbase-dev/mdbase-connect#1381. Keep this draft until an @mdbase-dev/sdk release contains it.

@callumalpass
callumalpass marked this pull request as ready for review November 10, 2026 11:41
@callumalpass
callumalpass merged commit e56f8cf into main Nov 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant