Skip to Content
Content Types

Content Types

Nibgate supports five content types: Article, Photo, Music, Video, and Document. Each type has a dedicated editor and presentation format.

All content types support free and paid gating. Set the price per post in the admin dashboard or via the package configuration.

Article

Articles are the primary content type for long-form writing.

Editor: Full-featured Markdown editor with toolbar support for headings, bold, italic, links, lists, blockquotes, and code blocks.

Media: Inline images can be embedded anywhere in the article body. A separate cover photo field controls the hero image shown on the blog homepage and in Explore cards.

Excerpt: A short summary displayed alongside the cover image. Set in the post editor.

import { createGate } from '@nibgate/sdk' const article = createGate({ id: 'my-article', type: 'article', title: 'My Premium Article', path: '/articles/my-article', price: '0.01', access: { humans: 'paid', agents: 'paid' }, unlock: { mode: 'one_time' } }) article.content()

Photo

Photos are gallery-style posts with multiple images.

Editor: Upload one or more images. Each image can have an optional caption.

Layout: Images are displayed in a responsive gallery grid on the blog. The cover is chosen per post by starring one image in the editor; the rest of the gallery renders as captioned thumbnails.

Encryption: All photo galleries are encrypted at rest — free or paid. Free galleries stream decrypted through the media proxy with no proof; a paid set keeps only the starred cover in plaintext, and the rest of the gallery is encrypted and stays hidden until the post is unlocked. See Content Encryption for how media and bodies are stored and revealed.

const photoSet = createGate({ id: 'photo-set-1', type: 'image', title: 'Photo Collection', path: '/photos/collection', price: '0.005', access: { humans: 'paid', agents: 'paid' }, unlock: { mode: 'one_time' } })

Music

Music posts allow creators to share audio tracks with embedded playback.

Editor: Upload an audio file (.mp3, .wav, .ogg) and optional cover art image. The audio file is encrypted at rest — only the cover art is stored in the clear.

Player: The post page embeds an <audio> player that streams the track through the encrypted-media proxy (/api/nibgate/media/:postId/audio).

Paid gating: When a track is premium, the player is hidden behind the unlock gate. Audio streams on paid posts only after the x-nibgate-payment-proof header is verified; free tracks stream decrypted to anyone.

const track = createGate({ id: 'track-1', type: 'music', title: 'Exclusive Track', path: '/music/track-1', price: '0.01', access: { humans: 'paid', agents: 'paid' }, unlock: { mode: 'one_time' } })

Video

Video posts embed YouTube videos with optional gating.

Editor: Paste a YouTube (or Vimeo, SoundCloud, Spotify) URL, or upload a video file. YouTube URLs are detected and the video ID extracted for embed; uploaded video files are encrypted at rest (videoEncryptedKey). A cover image is optional — it defaults to the YouTube thumbnail when a link is provided.

Player: The embed is rendered as an iframe (YouTube/Vimeo/SoundCloud/Spotify) or an inline <video> player for uploaded files.

Paid gating: When gated, the player is hidden behind an unlock overlay. Uploaded videos stream through the encrypted-media proxy only after proof; the full video is revealed after payment. YouTube embeds remain public (the video lives on YouTube) — gating covers the page and any companion material.

const course = createGate({ id: 'video-1', type: 'video', title: 'Premium Video Course', path: '/videos/course-1', price: '0.02', access: { humans: 'paid', agents: 'paid' }, unlock: { mode: 'one_time' } })

Document

Document posts share files that render in the browser and are downloadable after unlock.

Editor: Upload a document file plus an optional cover image and description. Supported formats are PDF, spreadsheets (.xlsx, .xls, .csv, .ods), Word (.docx, .doc), and text (.txt, .md).

Rendering: Spreadsheets and text files are rendered server-side to HTML (tables for sheets, escaped <pre> for text) so raw bytes never reach the client. .docx files are converted to HTML with mammoth. PDFs render inline in an iframe. Legacy formats (.xls, .doc, .ods) are download-only.

Paid gating: All documents are encrypted at rest. Free documents render in full without proof; on paid posts a truncated preview (12 rows for spreadsheets, 1600 characters for text) shows as a teaser before unlock, and the full document and download are revealed after payment.

const report = createGate({ id: 'report-1', type: 'document', title: 'Q3 Revenue Report', path: '/docs/report-1', price: '0.01', access: { humans: 'paid', agents: 'paid' }, unlock: { mode: 'one_time' } })

Content type comparison

AspectArticlePhotoMusicVideoDocument
Primary inputMarkdownImage filesAudio fileURL or video fileDocument file
Cover imageYes (separate field)Starred imageUploaded artAuto (YouTube thumb) or uploadOptional
Inline mediaYesCaptions per imageCover artEmbed or <video> playerRendered sheet/doc
PreviewExcerptPlaintext coverEncrypted audioOverlayTruncated preview
Full accessFull article bodyFull galleryFull track (encrypted)Full video (uploaded)Full file + download

Next reads

Last updated on