Campus SDK surface
Campus SDK is a library of stable Campus-owned primitives. It is not a product framework and does not own app rendering, state management, hydration, routing, or product-domain behavior.
Canonical browser entry
import { createCampusApp } from '/assets/campus_sdk/campus_browser.js'
const campus = createCampusApp({ appId: 'example-app' })
render()
await campus.ready()Construction is synchronous. Capability methods perform launch synchronization internally. This matches ordinary browser libraries and framework clients such as Firebase, Supabase, and Stripe: create a client, draw with local state, then call services as needed. It does not introduce a React- style lifecycle or require every app to implement hydrate.
Ownership map
| Capability | Typed browser SDK | Agent projection | App-to-app use |
|---|---|---|---|
| App/shell lifecycle | ready, fail, close, shell.* | bounded Campus MCP tools | SDK |
| Private backend transport | backend.* | only when the app publishes a tool | private SDK |
| Campus Apps | apps.list/search/get/create/fork/install/uninstall/open/start/warm/pause/stop | Campus MCP projection | SDK |
| Account/profile | account.* | Campus MCP projection where safe | SDK |
| Contacts | contacts.* | Campus MCP projection | SDK |
| App-local access | access.* | Campus MCP projection where safe | SDK |
| Permissions/settings | permissions.*, settings.* | trusted bounded projections | SDK |
| Small private JSON | kv() | none by default | SDK |
| Logical files | files.* | bounded Campus projections | SDK |
| E2E content graph | encryptedContent.* | bounded Campus projections | SDK |
| Keys/recipients/commitments | crypto.* | bounded intent only | SDK |
| Protected outbound credentials | secrets.* | brokered projection | SDK |
| Financial intent/authorizations | payments.* | exact trusted intent | SDK |
| Account event subscriptions | accountEvents.* | no generic event bus | SDK |
| Durable backend workflows | CampusServicesClient.runWorkflow, flow.activity | none | SDK + existing MCP/SDK effects |
| Notifications | notifications.* | Campus MCP projection | SDK |
| Schedules | schedules.* | Campus MCP projection | SDK |
| Search | search.* | Campus MCP projection | SDK |
| Intelligence/speech | intelligence.*, speech.* | Campus projection | SDK |
| MCP itself | mcp.* | native Agent consumer | SDK |
| Calls, Drop, Calendar, Messages, Mail, Drive, Wallet product operations | no product namespace | app-owned MCP | MCP |
The rule is ownership, not implementation location: Campus may execute a reviewed system app tool, but the app manifest still owns its name and schema. Conversely, Campus capabilities remain SDK capabilities even when MCP projects them for Agents.
Naming
- backend, not workload, in app-facing code;
- kv, not storage or defaults, for bounded keyed JSON;
- files for logical binary/large objects;
- encryptedContent for the endpoint-encrypted collaboration graph;
- accountEvents, not events, because it is not a generic bus;
- workflow/activity, for durable replay and one named idempotent effect;
- Agent component, not bot or app kind, for autonomous behavior declared by a Campus App.
CampusApp, storage(), content(), and workload-named browser methods are deprecated compatibility surface. New code uses createCampusApp(). Product classes such as CampusCalls and CampusCalendar are no longer exported.
Execution surfaces
| Surface | Entry | Purpose |
|---|---|---|
| Browser app | createCampusApp() | trusted launch plus typed Campus primitives and MCP client |
| JavaScript backend | CampusServicesClient.fromEnv() | installation-scoped Gateway services and leases |
| Rust backend | campus_sdk::CampusServicesClient | native equivalent |
| Native Agent MCP client | @campus/sdk/account-mcp | caller-filtered account/product MCP catalog over stdio |
| App MCP provider | manifest mcp.tools | app-owned product contract, using workload/browser/service transport |
service transport is reserved for reviewed systemSupplied packages published by Campus. Private or Store packages cannot select a Campus service executor.