Package-level declarations

The default Compose paywall, its configuration, style, and state.

Use PaywallView with a local PaywallConfiguration, a remote paywall identifier, or both. Create a PaywallModel to build custom product cards.

Types

Link copied to clipboard
data class PaywallConfiguration(val catalog: PurchaseCatalog, val defaultPurchaseOptionIdentifier: String? = null, val productDisplayContents: List<PaywallProductDisplayContent> = emptyList(), @StringRes val purchaseNoticeResource: Int? = null, val purchaseNoticeText: String? = null, val privacyPolicyUrl: String? = null, val termsOfServiceUrl: String? = null, val purchaseOptionDisplayContents: List<PaywallPurchaseOptionDisplayContent> = emptyList())

A paywall configuration defined in the app or resolved from a remote response.

Link copied to clipboard
class PaywallModel(val purchases: Purchases, localConfiguration: PaywallConfiguration? = null, paywallIdentifier: String? = null)

Coordinates local and remote paywall configuration with the purchase and restoration flow.

Link copied to clipboard

Purchase and restoration results that the paywall displays.

Link copied to clipboard
data class PaywallProductContext(val option: StorePurchaseOption, val selected: Boolean, val enabled: Boolean, val title: String, val description: String? = null, val isOwned: Boolean = false)

The store option and state passed to a custom product card.

Link copied to clipboard
data class PaywallState(val configuration: PaywallConfiguration? = null, val options: List<StorePurchaseOption> = emptyList(), val selectedOptionIdentifier: String? = null, val loading: Boolean = true, val busy: Boolean = false, val error: Throwable? = null, val notice: PaywallNotice? = null, val customerInfo: CustomerInfo? = null)

The products and progress state of a paywall.

Link copied to clipboard
data class PaywallStyle(val tintColor: Color = Color.Unspecified, val containerColor: Color = Color.Unspecified, val productCardColor: Color = Color.Unspecified, val selectedBorderBrush: Brush? = null, val selectedBorderLineWidth: Dp = 1.5.dp)

Colors that the app can customize for the paywall and its product cards.

Functions

Link copied to clipboard
fun DefaultPaywallProductCard(context: PaywallProductContext, tintColor: Color, backgroundColor: Color, onClick: () -> Unit)

The default product card that displays actual pricing phases and selection state.

fun DefaultPaywallProductCard(context: PaywallProductContext, tintColor: Color, backgroundColor: Color, selectedBorderBrush: Brush?, selectedBorderLineWidth: Dp = 1.5.dp, onClick: () -> Unit)
Link copied to clipboard
fun PaywallView(model: PaywallModel, modifier: Modifier = Modifier, isIncluded: (StorePurchaseOption) -> Boolean = { true }, style: PaywallStyle = PaywallStyle(), replacement: suspend (StorePurchaseOption) -> SubscriptionReplacement? = { null }, onPurchaseCompleted: () -> Unit = {}, productCard: @Composable (PaywallProductContext, () -> Unit) -> Unit? = null, content: @Composable ColumnScope.() -> Unit = {})

A paywall that presents product selection, purchases, restoration, and custom content using an existing PaywallModel.

fun PaywallView(purchases: Purchases, configuration: PaywallConfiguration? = null, paywallIdentifier: String? = null, modifier: Modifier = Modifier, isIncluded: (StorePurchaseOption) -> Boolean = { true }, style: PaywallStyle = PaywallStyle(), replacement: suspend (StorePurchaseOption) -> SubscriptionReplacement? = { null }, onPurchaseCompleted: () -> Unit = {}, content: @Composable ColumnScope.() -> Unit = {})

A paywall that uses a local configuration, or a remote paywall with an optional local fallback.