Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.pnlight.app/llms.txt

Use this file to discover all available pages before exploring further.

PNLight server-driven UI lets your app render screens configured in the dashboard. Use it for paywalls, prompts, upgrade screens, and other app surfaces that you want to update without a new app release.

How server-driven UI is selected

The app requests a placement with a locale and user ID. PNLight returns a config when the placement is enabled and a matching config is available. The dashboard tracks:
  • Requests: users who requested the placement.
  • Shown: users who received a UI config that could be shown.

Render a placement

RemoteUiView(placement: "paywall", cardId: "paywall_card") { action in
    if action.logId == "purchase_button" {
        let productId = action.params["id"] ?? ""
        Task { await purchase(productId) }
    }
}

Handle actions

Server-driven UI actions are delivered to your app. Use action IDs, paths, or query parameters to decide what the app should do. Common actions:
  • Start a purchase.
  • Close the screen.
  • Open another app screen.
  • Track a product interaction.
Always handle unknown actions. A safe fallback is to close the server-driven UI screen or ignore the action.

Prefetch configs

Prefetch a placement before you show it to reduce loading time.
PNLightSDK.shared.prefetchUIConfig(placement: "paywall")

Dashboard setup

Create and manage placements in Remote UI. See Remote UI placements for the dashboard workflow.