SDK reference
A source-generated companion to the Nibgate guides. Covers 27 implemented client methods and one standalone metadata validator, extracted from SDK 0.4.40 at 345fc04.
Built with Sourcey 3.9.0 using its Markdown adapter. Exact signatures come from the TypeScript declarations; behavior notes and examples are checked against the JavaScript implementation. This is a selected browser SDK reference, not full coverage of server, tracking, testing, wallet or tip APIs.
Start
npm install @nibgate/[email protected]import { createNibgate, validateResourceMetadata } from '@nibgate/sdk';
const client = createNibgate();
const resource = { id: 'article-1', title: 'Example article', type: 'article', price: '1' };
const validation = validateResourceMetadata(resource);
client.content(validation.resource);Events are telemetry. Keep protected content behind server verification; emitting unlockCompleted is not proof of payment. Browser event methods return false when queued or when no browser exists. Payment examples require app-provided wallet callbacks and must run only on intentional user action.
Coverage and known issues
The declaration contains 28 client methods but validateResourceMetadata is not wired into the client at runtime; import it separately. Transfer types are referenced but undeclared. The rating UI click handler has a boolean/Promise mismatch. Read each method's notes before use.
- gate — client-method
- content — client-method
- registerContent — client-method
- view — client-method
- track — client-method
- unlockStarted — client-method
- unlockCompleted — client-method
- paymentCompleted — client-method
- rateResource — client-method
- trackResourcePage — client-method
- checkResourceAccess — client-method
- payWithPaymentSignature — client-method
- createWalletCheckout — client-method
- createCircleGatewayBrowserAdapter — client-method
- createTransferCheckout — client-method
- payWithTransfer — client-method
- createEvmGatewayUnlock — client-method
- createHostedUnlock — client-method
- rateContentOnchain — client-method
- createOnchainRating — client-method
- mountRatingUI — client-method
- payAndUnlockResource — client-method
- setupResourcePage — client-method
- ratingMessage — client-method
- normalizeResource — client-method
- validateResourceMetadata — standalone-function
- normalizeContentType — client-method
- flush — client-method