@archetypeapi/pricing-page
TypeScript icon, indicating that this package has built-in type declarations

0.1.28 • Public • Published

Archetype Pricing Page

Drop-in pricing pages as React components.

Sync your public pricing page with Archetype data to launch new products, run A/B tests, and let your frontend team save time.

Getting Started

To get started with Archetype, view the quickstart guide.

Install the package:

npm i @archetypeapi/pricing-page

Requirements

react: "^18.1.0"

Usage

Setup

To get started, simply publish a pricing page from the Archetype dashboard. Archetype will generate some code for you.

  1. Navigate to Products → Create a Pricing Page
  2. Select your products then set your title, description, and redirect URL.
  3. Preview your layout. To re-order plans, simply drag-and-drop within the preview.
  4. Click "Publish & Copy Code" to copy the code snippet.

Grab your public_key from Archetype settings. Use a test key (archetype_pk_test...) to access test-mode products, or a prod key (archetype_pk_prod...) when you're ready to go live.

Installation

In a React 18 project (tested in Next.js), paste the snippet into a page or component:

import { PricingPage } from "@archetypeapi/pricing-page";

export default function Home() {
  return <PricingPage public_key={"archetype_pk_test_abc123"} config={{...}} />;
}

Configuration

The config gives programmatic control to some of your pages features. Typical example:

export default function Page() {
  return (
    <PricingPage
      public_key="archetype_pk_test_abc123"
      config={{
        title: "Pricing for Everyone",
        description: "A pricing plan for every scale.",
        featured_product_id: "product_abc123",
        radius: "round",
        colors: {
          primary: "#33d889",
          secondary: "#555",
          tertiary: "#777",
        },
        staging: false,
      }}
    />
  );
}

Looking to use our APIs directly? See the API reference.

Looking to develop with the package? Set staging: true to force the page to fetch data from a staging environment.

About Archetype

Archetype is the revenue infrastructure that makes API monetization quick and painless. It works by integrating a powerful, reliable purchase server with cross-platform support. Our open-source framework provides a backend wrapper around payment processors like Stripe to save engineers months of building custom billing infrastructure for their APIs.

Whether you are building a new API or already have millions of customers, you can use Archetype to:

Sign up to get started.

With Archetype, you can keep track of all your app transactions in one place — whether your customers are charged through iOS, Android, or the web. As the single source of truth for your API business, we make sure your customers' subscription status is always up to date.

Readme

Keywords

Package Sidebar

Install

npm i @archetypeapi/pricing-page

Weekly Downloads

0

Version

0.1.28

License

MIT

Unpacked Size

117 kB

Total Files

19

Last publish

Collaborators

  • musacoli
  • tyler_archetype
  • shaon-archetype
  • behailukt