Skip to main content

1. Overview

The kelviq React UI SDK provides a complete React-based solution for integrating dynamic, customizable pricing tables and paywalls into web applications. It handles fetching offering data, displaying pricing plans with multiple billing periods, managing subscriptions, and processing checkouts with full localization support.

2. Installation

Install the SDK using npm or yarn:

3. Quick Start

Basic Setup

Note: You must import the CSS file for the components to be styled correctly.

With Custom Event Handling


4. Core Components

4.1. KelviqProvider

The top-level provider component that initializes the SDK and manages the global state.

Required Props

Optional Props

API Configuration Options

4.2. KQPricingTable

The main pricing table component that displays all plans and handles user interactions.

Props

Example Usage

4.3. KQPlan

Renders a list of pricing plans with billing period switching.

Props

4.4. KQPlanItem

Displays a single pricing plan card.

Props

4.5. KQPrice

Renders formatted price display with currency and period information.

Props

4.6. KQFeatures

Renders the features list for a plan.

Props

Feature tooltips are controlled per-feature by the displayTooltipDescription flag on each feature in the offering data, configured in your kelviq dashboard — there is no global tooltip prop.

5. Data Types

Core Types

Color Configuration

Typography Configuration

Layout Configuration


6. Styling and Customization

6.1. CSS Variables

The SDK uses CSS variables for styling. You can override these in your CSS:

6.2. Custom Styles Object

6.3. Price Formatting

How prices are formatted is configured entirely in the SDK via the pricingOptions prop. Pass only the fields you want to change — the rest fall back to DEFAULT_PRICING_OPTIONS:
Defaults (DEFAULT_PRICING_OPTIONS):

6.4. Custom Action Button

6.5. noStyles Mode

For complete styling control, use the noStyles prop:

6.6. CSS Class Reference

The kelviq React UI components use consistent CSS class names that you can target for custom styling. All classes are prefixed with kq- to avoid naming conflicts.

CSS Class Hierarchy


7. Advanced Features

7.1. Usage-Based Pricing

The SDK supports metered billing and tiered pricing:

7.2. Custom Price Plans

Handle custom pricing plans with the onCustomPriceClick callback:

7.3. Subscription Management

The SDK automatically handles subscription updates:
  • New Subscriptions: Redirects to checkout
  • Plan Upgrades/Downgrades: Updates existing subscription
  • Free Plan Upgrades: Handles free trial to paid conversion

7.4. Error Handling


8. Complete Example


9. API Endpoints

The SDK uses the following default API endpoints:
  • Product Offering API: https://api.kelviq.com/api/v1/monetization/product-offering/{productId}/
  • Checkout API: https://api.kelviq.com/api/v1/checkout/
  • Subscription API: https://api.kelviq.com/api/v1/subscriptions
You can override these in the apiConfig:

10. Troubleshooting

Common Issues

  1. Loading State: Ensure your accessToken and productId are correct
  2. Styling Issues: Check CSS variable overrides and custom styles
  3. API Errors: Verify API endpoints and network connectivity
  4. TypeScript Errors: Ensure all required props are provided

Debug Mode

Enable console logging for debugging:

Using the Sandbox

If you want to use the sandbox, you need to set the environment option to sandbox in the KelviqProvider.

12. Support

For technical support and questions: