+ mdbase is the collection format and specification.
+ The other names describe software that reads a collection, connects
+ applications to it, or runs workflows beside it.
+
+
+
+
+
+ 01
+
+ Application
+
A project board, reporting tool, agent, or general collection editor.
+ TaskNotes and the mdbase-tasknotes command line tool can use the same
+ task type and Markdown records. Ordinary file tools continue to read
+ and version those records directly.
+
+
+
+
+ Obsidian
+ TaskNotes
+
Provides task views and editing inside an Obsidian vault with mdbase export enabled.
+
+ Is mdbase an application, a database, or a service?
+
+ mdbase is a specification for collections of Markdown records.
+ Implementations provide database-like operations over those files.
+ Connect is an optional service and local connector for application
+ authorization and routing.
+
+
+
+ Does an application need mdbase Connect?
+
+ An application can work directly with a conforming implementation.
+ Connect is useful when independent applications need user-approved
+ access to local or hosted collections through one SDK.
+
+
+
+ Can an existing Markdown folder become a collection?
+
+ Yes. Add mdbase.yaml, then introduce type definitions
+ as the collection needs validation, shared field meaning, links,
+ queries, or lifecycle rules.
+
+
+
+ Who can read collection records?
+
+ Local records are read by the registered connector and approved
+ applications. Hosted records are also readable by the hosted
+ provider so it can execute operations. The
+ security model names each boundary.
+
+ The production service currently accepts private-beta accounts. The
+ public SDK packages are also awaiting their first npm release. Start with
+ the local sandbox guide if you do not have
+ beta access.
+
+
+
+
Before you begin
+
This guide expects:
+
+
a private-beta account or the repository's local Connect stack;
+
a browser application running at http://localhost:5173;
+
Node 24 LTS and the repository's pinned pnpm version;
+
a Connect SDK source build or beta artifact.
+
+
+ The example manifest carries a complete workout type. Connect can install
+ that type during approval when the chosen collection does not yet provide
+ {" "}workout.record@1.
+
+
+
1. Add a bundled application manifest
+
+ Save this file at
+ {" "}public/.well-known/mdbase-app.json. The local URLs are valid
+ for development and require the validator's
+ {" "}--allow-local option.
+
+
+
+ The contract requirement limits compatible collections. The provision
+ makes a collection safely provisionable during approval and does not give
+ the application general type-management access.
+
+
+
2. Add the SDK and validator
+
After the public npm release, installation uses:
+
+
+ During the private beta, create immutable consumer archives from a clean
+ Connect checkout. The command prints the exact artifact filenames and
+ source revision. Add the printed protocol and client archives to the
+ application with pnpm add <archive>.
+
+
+
+ The validator is currently run from the Connect workspace or supplied as a
+ beta artifact:
+
+
+
+
3. Create one stable Connect client
+
+
+ The manager owns saved authorizations. The location helper owns the
+ bookmarkable collection ID, browser history changes, and authorization
+ return cleanup.
+
+
+
4. Start authorization from a user action
+
+
+ Connect presents ready and provisionable collections, then asks the user
+ to approve the listed operations. Collection records remain private until
+ approval succeeds.
+
+
+
5. Complete the exact callback route
+
+
+ Call this once at the manifest's callback path. PKCE is mandatory. A
+ successful callback stores the grant-bound authorization and returns a
+ collection-bound connection.
+
+
+
+
6. Query and update with a revision
+
+
+ Query results carry an opaque revision. Passing it as
+ {" "}if_revision prevents one application from silently
+ overwriting a newer change.
+
+
+
What success looks like
+
+
The Connect approval screen names Example Workouts.
+
The collection chooser marks a matching collection as ready or provisionable.
+
The approval screen lists the five requested operations.
+
The browser returns to /auth/mdbase/callback.
+
The console prints the stable ID of the approved collection.
+
The first incomplete workout receives completed: true.
+
+
+ Keep the collection ID in application URLs.
+
+ MdbaseBrowserLocation writes
+ {" "}?collection=<id> and follows browser back and forward
+ navigation. Collection IDs are opaque locators and can appear in browser
+ history and logs. They are not credentials.
+
+
diff --git a/src/pages/sdk/index.astro b/src/pages/sdk/index.astro
index 2287a50..b95e3e0 100644
--- a/src/pages/sdk/index.astro
+++ b/src/pages/sdk/index.astro
@@ -2,7 +2,6 @@
import DocsLayout from "../../components/DocsLayout.astro";
import CodeBlock from "../../components/CodeBlock.astro";
-const install = `pnpm add @mdbase/connect`;
const seam = `import type { MdbaseCollectionClient } from "@mdbase/connect";
export async function listOpenTasks(client: MdbaseCollectionClient) {
@@ -19,6 +18,7 @@ export async function listOpenTasks(client: MdbaseCollectionClient) {
description="Use the Connect SDK to authorize a collection and call typed mdbase operations."
active="overview"
headings={[
+ { href: "#start", label: "Where to start" },
{ href: "#choose-a-surface", label: "Choose a surface" },
{ href: "#application-shape", label: "Application shape" },
{ href: "#package-map", label: "Package map" }
@@ -26,20 +26,37 @@ export async function listOpenTasks(client: MdbaseCollectionClient) {
>
@mdbase/connect is the browser and native-shell SDK for
- applications that operate on a user's local or hosted mdbase collection. It
- owns application registration, OAuth with PKCE, grant renewal, local versus
- hosted route selection, encrypted relay requests, and typed operation
- envelopes.
+ applications that operate on one user-approved local or hosted mdbase
+ collection. The application asks for exact operations. Connect selects the
+ route and the collection authority checks the current grant.
-
+
Choose the first result you need
+
+
+ Learn the collection API
+
+ Run typed reads and revision-safe changes against an in-memory
+ collection. This path needs no account or running service.
+
- npm publication is pending.
+ Private-beta release status
- This is the public-beta install command. During private development, build
- the packages from the
- {" "}Connect repository.
- The production service and v1 protocol are already deployed.
+ The production service and protocol 1 are deployed for beta accounts.
+ The npm packages await their first public release. Current developers
+ build or pack the versioned artifacts from the
+ Connect repository.
@@ -148,7 +165,8 @@ export async function listOpenTasks(client: MdbaseCollectionClient) {
+ No account, connector, or hosted service is required.
- The production service currently accepts private-beta accounts. Use one
- of those accounts or the repository's local stack for this guide.
+ This example uses the real typed collection client and the deterministic
+ developer sandbox. It keeps every record in memory and makes no network
+ requests.
-
1. Add a bundled application manifest
-
- Save this file at public/.well-known/mdbase-app.json. The SDK
- loads the file from your own application and posts it inline during
- registration. The control plane receives the canonical JSON from the SDK.
-
-
+
Prerequisites
+
+
Git;
+
Node 24 LTS;
+
Corepack, which installs the repository's pinned pnpm version.
+
+
+
1. Build the current packages
- The reverse-domain ID and name are display metadata. An approved grant binds
- the canonical manifest content to the application installation that
- completed authorization.
+ The Connect packages await their first npm publication. Build the exact
+ beta packages from the public repository for this example.
+
-
2. Install the SDK and validator
-
-
- The packages are awaiting their first npm publication.
-
- The commands above are the public-beta installation path. Current
- development builds @mdbase/connect,
- {" "}@mdbase/connect-protocol, and
- {" "}@mdbase/connect-dev from the
- {" "}Connect repository.
-
-
-
Validate the bundled file during development and CI:
-
+
2. Download and run the complete example
- For a loopback development homepage and callback, add
- {" "}--allow-local. Production web homepages, icons, and
- browser callbacks use HTTPS. Native callbacks may use a private scheme
- derived from the application ID.
+ Save the example inside the developer package so Node resolves the local
+ workspace packages. The final command prints the result and exits.
-
-
3. Create one Connect client
-
+
- Keep this manager stable. It owns the set of saved connections and returns
- a separate collection-bound client for each one. Feature and repository
- code should receive that bound client, never ambient “current collection”
- state.
+ You can also
+ {" "}download the example file
+ {" "}and save it as
+ {" "}packages/devkit/sandbox-quickstart.mjs.
-
4. Start authorization from a user action
-
+
3. See what the example does
+
- Connect shows compatible collections and asks the user to approve the exact
- operations. The collection description becomes available after approval.
+ createSandbox() returns the same
+ {" "}MdbaseCollectionClient boundary used by a connected
+ collection. The example reads one seed record, creates a second record,
+ updates it with its revision token, and queries both task records.
-
5. Complete the callback
-
+
4. Check the expected result
+
- Call this once on the exact callback route listed in the manifest. PKCE is
- mandatory. On success, the client stores the grant-bound authorization and
- returns the newly approved collection-bound connection. The location
- helper restores the app-local return location, adds its collection ID, and
- removes temporary OAuth parameters.
+ A stale revision fails with a
+ {" "}concurrent_modification diagnostic. The sandbox also supports
+ typed CRUD, pagination, read defaults, and change cursors. CEL expressions,
+ authorization, routing, and filesystem behavior belong in real-stack
+ integration tests.
-
6. Query and update with a revision
-
+
5. Continue to a real collection
- Query results include a revision token. Pass it as
- {" "}if_revision when changing the record so a concurrent edit
- cannot be silently overwritten.
+ The next guide adds an application manifest, a provisionable workout
+ contract, browser authorization, and one approved local or hosted
+ collection.
-
- Use a stable collection ID in app URLs.
-
- MdbaseBrowserLocation writes
- {" "}?collection=<id>, follows browser back and
- forward navigation through onChange(), and auto-selects only
- when exactly one connection is saved. An explicit unavailable ID stays
- authoritative, so show the chooser or reconnect that ID. Collection IDs
- can appear in browser history and logs. They are opaque locators, not
- credentials. Names are display text and can change.
-
-
-
- Resolve domain fields from the contract descriptor.
-
- Generic apps can use declared mdbase types directly. Domain applications
- should read the contract descriptors returned by describe(){" "}
- or use an adapter maintained by the owning application.
-