@syncmatters/script-api
v1.0.11
Published
TypeScript type definitions for the SyncMatters script API (types only - scripts execute on the SyncMatters platform)
Readme
@syncmatters/script-api
TypeScript type definitions for the SyncMatters script API.
This is a types-only package: it provides IntelliSense and type checking when developing SyncMatters integration scripts and sync logic modules locally (for example in VS Code or Cursor). Script code executes on the SyncMatters platform, which provides the runtime implementation of this API.
Authoring guide (humans and AI assistants)
The complete guide to integration scripts and sync custom logic ships inside this package, version-locked to the types:
docs/script-sync-authoring.md— start here (cheat sheet + index); focused topic files sit alongside it.
If you are an AI assistant working in a CLI-pulled workspace: read that file before writing
script or sync logic code. Workspaces created by the sm CLI also contain an AGENTS.md
pointing here and at the connector guide in @syncmatters/connector-sdk.
Usage — integration script
import API from "@syncmatters/script-api";
/** @param {API.Context} ctx */
export async function main(ctx) {
ctx.log.info("Lets connect some systems!");
}Usage — sync logic module
import API from "@syncmatters/script-api";
export default class MySyncLogic {
/** @param {API.SyncLogicFilterFastContext} ctx @returns {Promise<boolean>} */
async filterFast(ctx) {
return true;
}
}Connector test harnesses additionally use the sdk-test entry point:
import SDKTest from "@syncmatters/script-api/sdk-test";Add "checkJs": true to your jsconfig.json to activate the JSDoc type annotations used in
script .mjs files.
