Unique identifier for the app
AppRuntime instance
import { createAppRuntime } from "@cpod/sdk";
const weatherApp = createAppRuntime("weather-app");
// Store API key securely
await weatherApp.config.setSecret("OPENWEATHER_API_KEY", "xxx");
// Track custom metric
await weatherApp.analytics.recordMetric({
name: "forecast_request",
value: 1,
dimensions: { city: "SF" }
});
// Send notification
await weatherApp.notifications.send({
type: "weather-alert",
title: "Severe Weather",
message: "Heavy rain expected",
priority: "high"
});
Create an isolated runtime for a specific app
Each app runtime provides isolated access to:
config- Environment variables, secrets, and app settingsanalytics- Custom metrics and usage trackingprompts- Prompt templates registration and executionnotifications- Send notifications to userstasks- Trigger and schedule background tasks