SDK Installation

The CmdCal self-hosted SDK lets you run the presentation engine on your own infrastructure. In this hardening pass, the supported self-hosted package is @paperjsx/pptx-core. The hosted V2 PresentationSpec remains the preferred wire contract, but the workspace @paperjsx/protocol package is internal/private.

Prerequisites

Step 1: Configure npm registry

Add CmdCal's private registry to your .npmrc:

Terminal
@paperjsx:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${PAPERJSX_NPM_TOKEN}

Set the PAPERJSX_NPM_TOKEN environment variable to the npm token shown in your dashboard.

Step 2: Install

Terminal
npm install @paperjsx/pptx-core

Step 3: Set your license key

Terminal
export PAPERJSX_KEY=pj_live_your_key_here

Or pass it directly when creating the engine instance.

Verification

TYPESCRIPT
import { CmdCal } from "@paperjsx/pptx-core";

const engine = new CmdCal({
  licenseKey: process.env.PAPERJSX_KEY!,
});

const pptx = await engine.renderDocument({
  type: "Document",
  meta: { title: "Test" },
  slides: [
    {
      type: "Slide",
      children: [
        {
          type: "Text",
          content: "Hello, CmdCal!",
          style: { x: 80, y: 80, width: 700, fontSize: 28, fontWeight: "bold" },
        },
      ],
    },
  ],
});

console.log(`Generated ${pptx.byteLength} bytes`);

Legacy Compatibility

AgentDocument and engine.generate() remain available for maintenance work, but they are compatibility-only surfaces. New integrations should start with the documented V2 runtime contract and either keep rendering hosted or convert semantic documents into PaperDocument upstream before self-hosted rendering.

License Validation

The SDK validates your license key on first use by contacting api.cmdcal.com. After successful validation:

  • The license is cached for 24 hours
  • If the validation server is unreachable, a 72-hour grace period allows offline use
  • No presentation data is sent during validation — only the license key and SDK version
SDK Installation — CmdCal Docs