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

midim-sdk

v0.1.0

Published

Official TypeScript/Node.js SDK for the MIDIM Verify API — MIDI provenance and rights verification

Readme

midim-sdk · TypeScript / Node.js

Official TypeScript SDK for the MIDIM Verify API — MIDI provenance, rights verification, and POIM status in one call.

Installation

npm install midim-sdk
# or
pnpm add midim-sdk
# or
yarn add midim-sdk

Requires Node.js 18+ (uses the built-in fetch). No external runtime dependencies.

Quick start

import { MidimClient } from "midim-sdk";

const midim = new MidimClient({ apiKey: "midim_..." });

// Verify by file hash
const result = await midim.verify({ asset_hash: "<sha256-hex-of-midi>" });

if (result.flagged) {
  console.log("Rights concern detected");
} else {
  console.log(`Rights confidence: ${result.rights_confidence}/100`);
}

Get your API key at midim.net/developer.

API Reference

All methods return a Promise and throw an enriched Error (with .status and .error fields) on non-2xx responses.

new MidimClient(options)

| Option | Type | Default | Description | |---|---|---|---| | apiKey | string | — | Required. API key starting with midim_ | | baseUrl | string | https://midim.net/api | Override for self-hosted or staging |


verify(input) → Promise<VerifyResponse>

POST /api/verify

Verify MIDI provenance, POIM status, rights, and marketplace eligibility in a single call. Provide at least one identifier.

| Input field | Type | Description | |---|---|---| | asset_hash | string? | SHA-256 hex hash of the MIDI file | | poim_certificate_id | string? | POIM certificate ID | | midi_file | string? | Base64-encoded MIDI file |

Returns VerifyResponse:

| Field | Type | Description | |---|---|---| | verification_id | string | Unique ID for this verification | | verification_timestamp | string | ISO 8601 timestamp | | known_asset | boolean | Whether the asset is in the MIDIM registry | | poim_registered | boolean | Whether a POIM certificate exists | | poim_level | number \| null | POIM level 1–4 (null if not registered) | | rights_confidence | number \| null | Rights confidence score 0–100 | | active_claims | number | Number of active rights claims | | license_status | string \| null | License status string | | marketplace_eligible | boolean | Whether the asset can be listed on a marketplace | | flagged | boolean | Whether the asset has unresolved rights concerns | | asset_id | number \| null | Internal MIDIM asset ID | | midim_id | string \| null | Public MIDIM asset identifier |


getProvenance(assetId) → Promise<ProvenanceRecord>

GET /api/provenance/{assetId}

Full certificate chain and lineage for an asset.

| Field | Type | Description | |---|---|---| | asset | object? | Asset metadata | | certChain | object[]? | Ordered list of POIM certificates | | lineage | object? | Fork / derivation history |


getCertificate(certId) → Promise<CertificateDetail>

GET /api/certificate/{certId}

Single POIM certificate with evidence and active claims.

| Field | Type | Description | |---|---|---| | certId | string? | Certificate ID | | assetId | number? | Asset ID | | poimLevel | number? | POIM level 1–4 | | status | string? | active | revoked | expired | | rights | object? | Rights breakdown | | claims | object[]? | Active claims against the certificate |


getClaims(assetId) → Promise<ClaimsList>

GET /api/claims/{assetId}

Active and resolved rights claims for an asset.

| Field | Type | Description | |---|---|---| | assetId | number? | Asset ID | | activeClaims | object[]? | Unresolved claims | | resolvedClaims | object[]? | Resolved claims |


getLicense(assetId) → Promise<LicenseStatus>

GET /api/license/{assetId}

License status and composition/arrangement rights.

| Field | Type | Description | |---|---|---| | assetId | number? | Asset ID | | licenseStatus | string? | Overall license status | | compositionStatus | string? | Composition rights status | | arrangementStatus | string? | Arrangement rights status | | rightsConfidence | number? | Confidence score 0–100 | | sourceWork | string \| null | Source work title if a derivative | | composer | string \| null | Composer attribution |


getMarketplaceEligibility(assetId) → Promise<MarketplaceEligibility>

GET /api/marketplace-eligibility/{assetId}

Check whether an asset can be listed on a marketplace.

| Field | Type | Description | |---|---|---| | assetId | number? | Asset ID | | eligible | boolean? | Eligible for marketplace listing | | reasons | string[]? | Blocking reasons if not eligible | | rightsConfidence | number? | Confidence score 0–100 |


getDatasetCompliance(datasetId) → Promise<DatasetCompliance>

GET /api/dataset-compliance/{datasetId}

Aggregate compliance report for an AI training dataset or collection.

| Field | Type | Description | |---|---|---| | datasetId | string? | Dataset identifier | | totalAssets | number? | Total assets in the dataset | | poimRegistered | number? | Number with POIM certificates | | poimDistribution | object? | Breakdown by POIM level | | licenseSummary | object? | License type distribution | | rightsCoverage | object? | Rights coverage statistics | | generatedAt | string? | ISO 8601 report timestamp |


Error handling

import { MidimClient } from "midim-sdk";

const midim = new MidimClient({ apiKey: "midim_..." });

try {
  const result = await midim.verify({ asset_hash: "abc123" });
} catch (err: any) {
  if (err.status === 401) {
    console.error("Invalid API key");
  } else if (err.status === 404) {
    console.error("Asset not found");
  } else {
    console.error(`MIDIM API error ${err.status}: ${err.error}`);
  }
}

Links