npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@shopimind/integration-kit-js

v1.6.0

Published

Foundation for building ShopiMind integrations: a runtime plus typed, once-tested primitives (HMAC webhook signatures, encryption, log redaction, a safe cursor-based sync engine, pagination/concurrency, persistence, ShopiMind SDK re-export, idempotent pro

Readme

@shopimind/integration-kit-js

CI

The toolkit for building a ShopiMind integration. You write your business logic; the kit provides all the infrastructure.

An integration has to receive lifecycle webhooks, sync data reliably, expose widgets, and talk to the ShopiMind API securely. With this kit you only declare what is specific to your system (pure functions + declarations) — the rest is provided and tested once.

The kit handles for you:

  • 🔐 Secured webhooks — HMAC signature verification + anti-replay
  • 🔄 Incremental, cursor-safe sync — no data loss on error
  • 🌊 Streaming pagination + bounded concurrency — no memory blow-up, no request bursts (429)
  • 💾 Local persistence (SQLite) with encrypted secrets at rest
  • 🔌 Typed ShopiMind API client (the SDK, re-exported)
  • ⚙️ Idempotent provisioning of data sources, custom data and events
  • 🌐 HTTP server + lifecycle handling (install / activate / config / sync)
  • 🧩 Widget declarations

Requirements

Node.js 18+ and TypeScript (ESM / NodeNext).

Install

npm i @shopimind/integration-kit-js

The ShopiMind SDK is a dependency and is re-exported, so you can import SDK resources directly from the kit.

Quick start

1. Describe your integration

// integration.ts
import { defineIntegration } from '@shopimind/integration-kit-js';

export const integration = defineIntegration({
  slug: 'my-pos',
  meta: { name: 'My POS', version: '1.0.0' },

  configSchema: { steps: [ /* the configuration form shown to the merchant */ ] },
  parseSettings: (raw) => ({ /* your typed settings */ }),

  testConnection: async (ctx) => {
    // check access to the partner system with ctx.settings
    return true;
  },

  provisioning: async (ctx) => ({
    dataSources: [ /* ... */ ],
    customData:  [ /* ... */ ],
    events:      [ /* ... */ ],
  }),

  widgets: [ /* widgets exposed in the ShopiMind editor */ ],

  syncSteps: [
    {
      entity: 'customers',
      cursorScope: 'global',
      enabled: (s) => s.syncCustomers,
      run: async (ctx) => {
        // ctx.sendBulk(fn, items) — safe push · ctx.spm + SDK statics · ctx.paginate(...) · ctx.state · ctx.logger
        return { items: 0, errors: [] };
      },
    },
  ],
});
// Integration<S> types every field (strict TypeScript).

2. Run the app

// main.ts
import { createIntegrationApp } from '@shopimind/integration-kit-js';
import { integration } from './integration.js';

const env = process.env;

const app = createIntegrationApp(integration, {
  databasePath: env.DATABASE_PATH ?? './data/store.sqlite',
  webhookSecret: env.WEBHOOK_SECRET!,     // HMAC secret for ShopiMind webhooks
  credentialsKey: env.CREDENTIALS_KEY,    // 64-hex AES key used to encrypt stored secrets
  port: env.PORT ? Number(env.PORT) : 8080,
});

void app.start();

createIntegrationApp wires the HTTP server, the lifecycle dispatcher (signed webhooks), persistence and the sync engine — the kit builds the ShopiMind SDK client itself. You only have to deploy.

Encryption is fail-closed. Without credentialsKey, startup fails — pass allowPlaintextSecrets: true to allow plaintext secret storage for local development only.

The building blocks of an integration

| Field | Role | |---|---| | configSchema | the configuration form shown to the merchant | | parseSettings | turns the raw config into typed settings | | testConnection | checks access to the partner system | | provisioning | idempotently creates the data sources / custom data / events on the ShopiMind side | | widgets | widgets exposed in the ShopiMind editor | | syncSteps | the sync steps — the cursor is managed by the kit | | hooks (optional) | lifecycle callbacks (onActivate, onConfigUpdated, ...) |

Admin operations UI

The kit ships a small, self-contained operations console for you, the integrator — set an adminToken and open http://<host>:<port>/admin/ui. It runs entirely on your side (it only reads the local SQLite store) and lets you:

  • browse installations and drill into cursors, sync runs, webhooks, inbound events and state;
  • inspect the dead-letter (items the ShopiMind API refused) and the audit trail;
  • trigger sync, reprovision, purge a rejected item, or reveal a single payload.

Safe by default: PII is masked (emails, phones, names…) unless you explicitly reveal it (an audited action), secrets are never returned, browser access uses an HttpOnly SameSite=Strict session cookie + a CSRF token, and every action is rate-limited.

const app = createIntegrationApp(integration, {
  databasePath: env.DATABASE_PATH ?? './data/store.sqlite',
  webhookSecret: env.WEBHOOK_SECRET!,
  credentialsKey: env.CREDENTIALS_KEY,
  adminToken: env.ADMIN_TOKEN,   // enables /admin/* and the UI (use a 32+ char high-entropy token)
  adminPort: 9090,               // recommended: serve /admin on a PRIVATE listener…
  adminHost: '127.0.0.1',        // …bound to loopback (the default when adminPort is set)
  adminSecureCookie: true,       // mark the session cookie Secure (serve the UI over HTTPS)
});

Keep the admin port on a private interface (or behind your ingress). When adminPort is omitted, /admin/* shares the public server — fine for local dev, warned about otherwise.

Guarantees

  • The cursor only advances when a step finished without error → no silent data loss; the window is replayed on the next run.
  • Partner secrets are encrypted at rest and redacted in logs.
  • Pagination streams and concurrency is bounded → controlled memory, no request bursts.
  • Webhooks are verified (signature + anti-replay window) before any processing.
  • The admin UI is integrator-side and safe by default — PII masked, secrets never returned, every action audited, session cookie hardened.

License

Source-available, proprietary — see LICENSE. You may use and modify the kit for your own use of the ShopiMind service; redistribution and independent use are not granted.