openpetswithchatandmcp/packages/sdk
2026-06-11 21:25:55 +02:00
..
src Add Virtual Pet HUD plugin 2026-06-11 21:25:55 +02:00
package.json superplugins 2026-06-10 08:16:38 +02:00
README.md feat(sdk): add @open-pets/plugin-sdk types package, CLI scaffolder, and drift guard 2026-06-09 20:24:02 +02:00
tsconfig.json feat(sdk): add @open-pets/plugin-sdk types package, CLI scaffolder, and drift guard 2026-06-09 20:24:02 +02:00

@open-pets/plugin-sdk

Type definitions for building OpenPets desktop pet plugins.

This package is types only. There is no runtime to import — the OpenPets desktop app injects the OpenPetsPlugin global into your plugin's sandbox and passes your start(ctx) handler the SDK. Installing this package gives your editor autocomplete and type-checking; it never ships in your plugin.

Install

npm i -D @open-pets/plugin-sdk

Use

A plugin is a single browser-style JavaScript file. Reference the types for IntelliSense:

/// <reference types="@open-pets/plugin-sdk" />

OpenPetsPlugin.register({
  async start(ctx) {
    await ctx.pet.speak("Hello!")
    await ctx.pet.react("waving")
  },
})

Or, in TypeScript, import the contract directly:

import type { OpenPetsContext, OpenPetsPluginDefinition } from "@open-pets/plugin-sdk"

Docs