@lockethq/snapback-sdk
v0.1.2
Published
The official Snapback Integration SDK — build capture/restore integrations for Snapback work-state snapshots.
Maintainers
Readme
@lockethq/snapback-sdk
The official Snapback Integration SDK — build capture/restore integrations for Snapback work-state snapshots.
An integration captures one slice of your working environment (browser tabs, editor state, terminals, AI threads, native windows…) into an opaque, versioned JSON Fragment, and restores it later. The core engine stores, encrypts, syncs, and diffs fragments without understanding their payloads — so your integration owns its own shape and evolves independently.
Install
npm install @lockethq/snapback-sdkESM-only. Requires Node 22+.
Usage
import { defineIntegration, notRunning, type CaptureContext, type RestoreContext } from '@lockethq/snapback-sdk';
import { foregroundApps, openApp } from '@lockethq/snapback-sdk/macos';
export default defineIntegration<MyPayload>({
id: 'com.example.my-integration',
name: 'My Integration',
schemaVersion: 1,
async capture(ctx: CaptureContext) {
// gather state → return a Fragment payload
},
async restore(payload, ctx: RestoreContext) {
// re-create the captured state
},
});Subpath exports
@lockethq/snapback-sdk— the integration contract:defineIntegration,defineHandoffIntegration, option-field helpers, id codecs, and all supporting types.@lockethq/snapback-sdk/macos— native-bridge helpers for macOS (open/osascriptwrappers, foreground-app detection, path helpers). Node-only.
License
MIT
