@archetypeapi/pricing-page
v0.1.28
Published
Generate a pricing page from the Archetype dashboard.
Downloads
7
Keywords
Readme
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.
- Navigate to Products → Create a Pricing Page
- Select your products then set your title, description, and redirect URL.
- Preview your layout. To re-order plans, simply drag-and-drop within the preview.
- 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:
- Fetch products, make purchases, and check subscription status with our native SDKs.
- Host and configure products remotely from our dashboard.
- Analyze the most important metrics for your app business in one place.
- See customer transaction histories, chart lifetime value, and grant promotional subscriptions.
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.