App Runtime - Isolated per-app runtime with config, analytics, prompts, notifications, and tasks
This module is pending backend implementation. All methods will throw NotImplementedError until the backend endpoints are available.
const runtime = createAppRuntime("my-app-id");// Configawait runtime.config.setEnv("API_KEY", "secret");const apiKey = await runtime.config.getEnv("API_KEY");// Analyticsawait runtime.analytics.recordMetric({ name: "requests", value: 1 });// Promptsconst result = await runtime.prompts.execute({ prompt_name: "greeting", variables: { name: "World" } });// Notificationsawait runtime.notifications.send({ user_id: "user-123", title: "Hello", message: "Welcome!" });// Tasksawait runtime.tasks.trigger({ name: "process-data", payload: { items: 100 } }); Copy
const runtime = createAppRuntime("my-app-id");// Configawait runtime.config.setEnv("API_KEY", "secret");const apiKey = await runtime.config.getEnv("API_KEY");// Analyticsawait runtime.analytics.recordMetric({ name: "requests", value: 1 });// Promptsconst result = await runtime.prompts.execute({ prompt_name: "greeting", variables: { name: "World" } });// Notificationsawait runtime.notifications.send({ user_id: "user-123", title: "Hello", message: "Welcome!" });// Tasksawait runtime.tasks.trigger({ name: "process-data", payload: { items: 100 } });
Readonly
Get the app ID
App Runtime - Isolated per-app runtime with config, analytics, prompts, notifications, and tasks
Remarks
This module is pending backend implementation. All methods will throw NotImplementedError until the backend endpoints are available.
Example