MonaKiosk in Action / Getting Started

What is MonaKiosk?

MonaKiosk is an Astro integration that adds paywall capabilities to your content site. It connects your Markdown/MDX content to Polar.sh, a developer-focused monetization platform, enabling you to sell access to premium content without building a custom backend.

The Problem

Astro excels at content-driven sites — blogs, documentation, educational platforms. But adding monetization is typically painful:

  • Most payment solutions assume a complex backend
  • Content paywalls require custom access control logic
  • Managing products, customers, and entitlements is tedious
  • You end up bolting external systems onto Astro rather than integrating naturally

What if monetization could feel native to Astro’s content-first approach?

The Solution

MonaKiosk makes paywalling as simple as adding a field to your frontmatter:

---
title: "Advanced TypeScript Patterns"
description: "Deep dive into advanced TypeScript techniques"
price: 999 # $9.99 in cents
---

That’s it. MonaKiosk handles:

  • Product sync — Creates/updates Polar products at build time
  • Access control — Middleware checks if the user has purchased
  • Checkout flow — Redirects to Polar’s hosted checkout
  • Preview generation — Shows teaser content to non-purchasers
  • File delivery — Serves downloadable files to customers

Key Features

FeatureDescription
Content-native pricingPrice lives in frontmatter alongside your content
One-time & subscriptionsSupport both pricing models
Grouped contentSell courses where one purchase unlocks all chapters
Downloadable filesAttach PDFs, ZIPs, or any files to paywalled content
Custom templatesOverride paywall and preview UI
Auth flexibilityWorks standalone or with Better Auth, Auth.js, etc.

How It Compares

ApproachProsCons
Custom backendFull controlHigh effort, maintenance burden
Gumroad/PayhipEasy setupExternal to your site, no content integration
Stripe + custom codeFlexibleRequires building access control
MonaKiosk + PolarNative Astro integration, minimal codeTied to Polar ecosystem

MonaKiosk is ideal when you want monetization that feels like a natural extension of Astro’s content collections.

Architecture Overview

flowchart LR
    subgraph Your Site
        A[Astro Content] --> B[MonaKiosk Integration]
        B --> C[Middleware]
    end

    subgraph Polar.sh
        D[Products]
        E[Customers]
        F[Checkout]
    end

    B -->|Build time sync| D
    C -->|Runtime access check| E
    C -->|Redirect| F

At build time, MonaKiosk scans your content for price fields and syncs products to Polar. At runtime, the middleware intercepts requests to paywalled content, checks access via Polar’s API, and either serves the full content or shows a preview with a purchase button.

What You’ll Build

Throughout this course, we’ll build a complete monetized content site with:

  1. Paywalled blog posts — Individual articles with one-time purchase
  2. Premium courses — Multi-chapter content with single purchase
  3. Downloadable resources — Files delivered to customers

Let’s start by installing MonaKiosk.