@moonbooth/sdk
v0.3.0
Published
TypeScript SDK for the Moonbooth API
Maintainers
Readme
@moonbooth/sdk
TypeScript SDK for the Moonbooth API. It wraps the hosted service's account paths: capabilities and their versions, transfers, share links, verification runs and receipts, capability passports, and adoption records. A second client, BoothClient, covers booth coordination (state, events, commitments, checks, briefs) for a booth you hold a credential for.
Install
npm install @moonbooth/sdkExample
import { ActClient } from "@moonbooth/sdk";
const client = new ActClient({
baseUrl: "https://www.moonbooth.ai",
token: process.env.MOONBOOTH_API_TOKEN, // an API token from your Moonbooth dashboard
});
const { capabilities } = await client.listCapabilities();
for (const capability of capabilities) {
console.log(capability.id, capability.name);
}API errors throw ActApiError with the HTTP status and the service's error code. A custom fetch implementation can be passed as fetchFn in the client options, which is how the test suites run the client without a network.
Scope note: the SDK covers the account paths and booth coordination reads and writes listed above. Exchanging a package inside a free booth (offer, inspect, accept, download as the booth recipient) is not in the SDK yet; that flow runs over the HTTP API today.
Links
- Homepage: https://www.moonbooth.ai
- Repository: https://github.com/moonboothai/moonbooth (this package lives in
packages/sdk-typescript) - Issues: https://github.com/moonboothai/moonbooth/issues
License
MIT
