TypeScript SDK
The TypeScript SDK provides a type-safe client for integrating with Subnoto’s API. It handles authentication, encryption, and provides helper functions for common operations.
Installation
Section titled “Installation”npm install @subnoto/api-client# orpnpm add @subnoto/api-client# oryarn add @subnoto/api-clientQuick Start
Section titled “Quick Start”import { SubnotoClient } from "@subnoto/api-client";
const client = new SubnotoClient({ apiBaseUrl: "https://enclave.subnoto.com", accessKey: process.env.API_ACCESS_KEY, secretKey: process.env.API_SECRET_KEY, unattested: false});
// Use openapi-fetch syntaxconst { data, error } = await client.POST("/public/workspace/list", { body: {} });Configuration
Section titled “Configuration”| Option | Type | Required | Description |
|---|---|---|---|
apiBaseUrl | string | Yes | API base URL |
accessKey | string | Yes | API access key |
secretKey | string | Yes | API secret key |
unattested | boolean | No | Use unattested mode (default: false) |
attesterKey | Buffer | No | Public key for attestation |
Document Upload
Section titled “Document Upload”The SDK includes a helper function for uploading documents:
import { SubnotoClient } from "@subnoto/api-client";import { readFileSync } from "fs";
const client = new SubnotoClient({ apiBaseUrl: "https://enclave.subnoto.com", accessKey: process.env.API_ACCESS_KEY, secretKey: process.env.API_SECRET_KEY});
const fileBuffer = readFileSync("path/to/document.pdf");
const { envelopeUuid, documentUuid } = await client.uploadDocument({ workspaceUuid: "your-workspace-uuid", fileBuffer: fileBuffer, envelopeTitle: "My Document"});API Reference
Section titled “API Reference”The SDK uses openapi-fetch syntax for all API calls. All endpoints are type-safe and match the OpenAPI specification.
For complete API documentation, see the OpenAPI specifications.
Package
Section titled “Package”- NPM: @subnoto/api-client
- License: Apache-2.0