@cornerstonestack/sdkFramework-independent clients for Cornerstone services.
Use the SDK transport and domain clients outside UI code while keeping credentials and environment policy in the consuming application.
@cornerstonestack/sdk is currently a private workspace package. This guide documents its reviewed contract; it does not claim a public npm release.
Contract principles
- The SDK owns framework-independent communication with Cornerstone backend services.
- The SDK must not import React or TanStack Query.
- Environment values and token providers are injected by the consuming application; the SDK contains no credentials.
- All transport failures become CornerstoneError values with normalized status, code, message, validation, retry, detail, and cause fields.
Public package exports
@cornerstonestack/sdk/client@cornerstonestack/sdk/errors@cornerstonestack/sdk/experience-studio@cornerstonestack/sdk/spark@cornerstonestack/sdk/spark/typesCreate clients
import {
createExperienceStudioApi,
createHttpClient,
createSparkApi,
} from '@cornerstonestack/sdk'
const client = createHttpClient({
baseUrl: featureDataUrl,
getAccessToken,
requireAccessToken: true,
})
const sparkApi = createSparkApi({ client })
const experienceStudioApi = createExperienceStudioApi({ client })Add an endpoint
- Add request and response boundary types to the domain types file.
- Add a clearly named domain method to the domain API factory.
- Send requests through createHttpClient; do not repeat token, JSON, status, or error parsing logic.
- Test the action and path, request body, response selection, abort behavior, and failure mapping.
Domain boundaries
Spark exposes snapshot operations for personal and shared scopes.
Experience Studio exposes explicit Project, Program, Course, Module, and Activity operations.
Requests use object arguments, forward abort signals, and share the client authentication and normalized error contract.
Wire DTOs, persisted domain entities, and view models remain separate when their shapes differ.