Send content metadata
Content metadata tells Nibgate what paid resources exist without copying the protected resource itself.
Supported types
Minimum payload
Send a stable external id, type, title, URL, price, currency, tags, and optional preview image.
import { createGate } from "@nibgate/sdk"
const post = createGate({
id: "post_123",
type: "article",
title: "Paid research note",
path: "/research",
url: "https://creator.com/research",
price: "2.00",
currency: "USDC",
tags: ["research", "ai"],
access: {
humans: "paid",
agents: "paid"
},
unlock: {
mode: "one_time"
}
})
post.content()Note: the package exports
createGate(and a preconfigurednibgate.gate(...)). There is no baregateimport.
Recommended fields
| Field | Purpose |
|---|---|
id | Stable id from the creator app. |
type | One of article, image, music, video, document. |
title | Public content title. |
url | Public route where the resource can be unlocked. |
price | Display and analytics price. |
currency | Usually USDC for current flows. |
tags | Search and Explore filtering. |
imageUrl | Public image shown in Explore (also accepts image). |
recipient | Wallet or payment receiver for paid unlocks. |
access | Human and agent access policy. |
unlock | Unlock policy. Use mode: "one_time" — the shipped, production-ready mode. |
whitelist | Supporter wallets — a price tier (with whitelistPrice) and/or invite list (publicAccess: false). |
The creator site remains the source of truth. Nibgate stores metadata for search, analytics, and Explore, not the protected paid file itself.
Content lifecycle
Content can be reported repeatedly. Use the same id so Nibgate updates the same content record instead of creating duplicates.
When metadata changes on the creator site, the hub refreshes the stored record the next time the widget/package reports that resource. Verified sites can also expose a manifest at /nibgate.json, /.well-known/nibgate.json, /v1/nibgate/manifest, or /v1/nibgate/nibgate.json; the dashboard “Refresh metadata” action and backend manifest sweep both use those routes to pull updated titles, descriptions, images, prices, tags, policies, publisher data, and routes.
Unlock policy
The shipped unlock mode is one_time:
unlock: {
mode: "one_time"
}The field exists so future versions can add metered streaming, metered reading, time passes, and agent quotas without changing how creators describe content.
Document
Document resources represent PDF, spreadsheet, Word, and text files. The external id, title, URL, price, and tags are reported the same way as other types — the file itself stays on the creator site and is never copied into the hub.
const report = createGate({
id: "report_456",
type: "document",
title: "Q3 Revenue Report",
path: "/docs/report-456",
url: "https://creator.com/docs/report-456",
price: "0.01",
currency: "USDC",
tags: ["report", "finance"],
access: { humans: "paid", agents: "paid" },
unlock: { mode: "one_time" }
})
report.content()Documents are encrypted at rest. Free documents render in full without proof; on paid posts a truncated preview (12 spreadsheet rows or 1,600 characters of text) is served as a teaser before unlock.
Deterministic content id
For reputation and rating contracts, every content item resolves to a stable content id.
The shape is:
contentHash = keccak256("nibgate:content:v1" + "|" + domain + "|" + externalId + "|" + url)The creator does not need to mint each content item. The package derives this id from the verified site domain, the resource’s external id, and its URL — then uses it for unlock receipts, rating eligibility, and rating events. The same derivation lives in contentHashFor (backend/src/server/hub/helpers.js:551) and in the SDK’s contentHashFor (packages/nibgate/src/browser/reputation.js:116).
Rating handoff
After a wallet or agent unlocks a resource, the package can expose a rating flow in a later adapter. Unlock/payment remains creator-site native; the receipt makes the wallet eligible to rate. The package should resolve the content id, check unlock eligibility from the indexed receipt, and then either submit a rating transaction or create an attested rating proof depending on the site configuration.