Skip to content

Latest commit

 

History

History
108 lines (79 loc) · 2.79 KB

File metadata and controls

108 lines (79 loc) · 2.79 KB

Capture SDK

Official SDKs for Numbers Protocol Capture API. Register digital assets with blockchain-backed provenance.

Available in two languages:

Installation

TypeScript/JavaScript

npm install @numbersprotocol/capture-sdk

Python

pip install numbersprotocol-capture-sdk

Quick Start

TypeScript

import { Capture } from '@numbersprotocol/capture-sdk'

const capture = new Capture({ token: 'YOUR_TOKEN' })

// Register an asset
const asset = await capture.register('./photo.jpg', { caption: 'My photo' })

// Get provenance data
const tree = await capture.getAssetTree(asset.nid)

Python

from numbersprotocol_capture import Capture

capture = Capture(token='YOUR_TOKEN')

# Register an asset
asset = capture.register('./photo.jpg', caption='My photo')

# Get provenance data
tree = capture.get_asset_tree(asset.nid)

API Overview

Method TypeScript Python
Register asset register(file, options?) register(file, **options)
Update metadata update(nid, options) update(nid, **options)
Get asset get(nid) get(nid)
Get history getHistory(nid) get_history(nid)
Get provenance getAssetTree(nid) get_asset_tree(nid)

Documentation

Requirements

  • TypeScript: Node.js 18+ or modern browser
  • Python: Python 3.14+
  • API Token: Get from Capture Dashboard

Repository Structure

capture-sdk/
├── ts/                    # TypeScript SDK
│   ├── src/               # Source code
│   ├── package.json       # npm package config
│   └── README.md
├── python/                # Python SDK
│   ├── numbersprotocol_capture/  # Source code
│   ├── pyproject.toml     # PyPI package config
│   └── README.md
├── scripts/               # Maintenance tools
│   ├── sync-versions.py   # Version sync tool
│   └── check-feature-parity.py
└── .github/workflows/     # CI/CD
    ├── ci.yml             # Test & lint
    └── release.yml        # Publish to npm/PyPI

Version Synchronization

Both SDKs maintain the same version number. To release:

# Bump version in both SDKs
python scripts/sync-versions.py --bump minor

# Create and push tag
git tag v0.2.0
git push origin v0.2.0

CI automatically publishes to npm and PyPI when a tag is pushed.

License

MIT