npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@agentpaid/paid-nextjs-client

v0.3.1

Published

Official NextJS Component SDK for the Paid.ai APIs.

Readme

Paid.ai Blocks

Easily embed Paid.ai blocks in your Next.js app to display payments, invoices, and activity logs for specific customers.

Quick Setup

  1. Install: npm install @agentpaid/paid-nextjs-client
  2. Add API key: Set PAID_API_KEY in your .env.local
  3. Create one API route: src/app/api/[paidEndpoint]/[...params]/route.ts
  4. Use components: Import and use PaidContainer or individual blocks

That's it! No complex configuration needed.


Installation

npm install @agentpaid/paid-nextjs-client
# or
yarn add @agentpaid/paid-nextjs-client

Blocks

PaidContainer (Recommended)

The PaidContainer is an all-in-one tabbed interface that displays payments, invoices, and activity logs in a single block. This is the easiest way to integrate all Paid.ai data views.

import { 
  PaidContainer, 
  PaidActivityLog, 
  PaidInvoiceTable, 
  PaidPaymentsTable 
} from '@agentpaid/paid-nextjs-client';

<PaidContainer 
  title="Customer Overview"
  description="Here's a breakdown of recent activity for your customer."
  defaultActiveTab="payments"
  tabs={[
    {
      id: 'payments',
      label: 'Payments',
      component: <PaidPaymentsTable customerExternalId="customer_123" />
    },
    {
      id: 'invoices', 
      label: 'Invoices',
      component: <PaidInvoiceTable customerExternalId="customer_123" />
    },
    {
      id: 'activity-log',
      label: 'Activity Log', 
      component: <PaidActivityLog customerExternalId="customer_123" />
    }
  ]}
  paidStyle={{
    fontFamily: 'Inter',
    primaryColor: '#1f2937',
    containerBackgroundColor: '#f8fafc',
    buttonBgColor: '#3b82f6'
  }}
/>

Individual Blocks

For more granular control, you can use individual blocks:

import { 
  PaidPaymentsTable, 
  PaidInvoiceTable, 
  PaidActivityLog 
} from '@agentpaid/paid-nextjs-client';

// Payments only
<PaidPaymentsTable customerExternalId="customer_123" />

// Invoices only  
<PaidInvoiceTable customerExternalId="customer_123" />

// Activity log only
<PaidActivityLog customerExternalId="customer_123" />

API Routes Setup

You need to create a single API route to handle all Paid.ai endpoints. First, add your Paid.ai API key to .env.local:

PAID_API_KEY=your_paid_ai_api_key_here

Single Unified API Route

Create one API route that handles all four endpoints:

mkdir -p "src/app/api/[paidEndpoint]/[...params]" && touch "src/app/api/[paidEndpoint]/[...params]/route.ts"

Add to src/app/api/[paidEndpoint]/[...params]/route.ts:

import { handleBlocks } from '@agentpaid/paid-nextjs-client';

export const GET = handleBlocks();

Complete Example

import { 
  PaidContainer,
  PaidActivityLog,
  PaidInvoiceTable,
  PaidPaymentsTable
} from '@agentpaid/paid-nextjs-client';

export default function CustomerDashboard() {
  return (
    <div style={{ padding: '2rem', fontFamily: 'sans-serif' }}>
      <h1>Customer Dashboard</h1>

      <section style={{ marginBottom: '2rem' }}>
        <p><strong>Welcome back!</strong></p>
        <p>Here's a complete overview for customer <code>customer_123</code>.</p>
      </section>

      <PaidContainer 
        title="Customer Overview"
        description="Complete breakdown of payments, invoices, and activity."
        defaultActiveTab="payments"
        tabs={[
          {
            id: 'payments',
            label: 'Payments',
            component: <PaidPaymentsTable customerExternalId="customer_123" />
          },
          {
            id: 'invoices',
            label: 'Invoices', 
            component: <PaidInvoiceTable customerExternalId="customer_123" />
          },
          {
            id: 'activity-log',
            label: 'Activity Log',
            component: <PaidActivityLog customerExternalId="customer_123" />
          }
        ]}
        paidStyle={{
          // Global styling
          fontFamily: 'Inter, sans-serif',
          primaryColor: '#1f2937',
          secondaryColor: '#6b7280',
          
          // Container & backgrounds
          containerBackgroundColor: '#f8fafc',
          tableBackgroundColor: '#ffffff',
          tableHeaderBackgroundColor: '#f1f5f9',
          
          // Tabs
          tabBackgroundColor: '#e2e8f0',
          tabActiveBackgroundColor: '#3b82f6',
          tabHoverBackgroundColor: '#cbd5e1',
          
          // Interactive elements
          tableHoverColor: '#f1f5f9',
          buttonBgColor: '#3b82f6'
        }}
      />

      <section style={{ marginTop: '2rem' }}>
        <p>Need help? Visit our <a href="/support">support center</a>.</p>
      </section>
    </div>
  );
}

Styling System

The Paid.ai blocks use a simplified, universal styling system. All blocks accept a paidStyle prop with the following properties:

Universal Style Properties

| Property | Description | Default | |----------|-------------|---------| | fontFamily | Global font family for all text | 'Roboto' | | primaryColor | Primary text color | '#374151' | | secondaryColor | Secondary text color | '#6b7280' | | containerBackgroundColor | Main container background | '#f8f9fa' | | tableBackgroundColor | Table body background | '#ffffff' | | tableHeaderBackgroundColor | Table header background | '#f9fafb' | | tabBackgroundColor | Tab background (PaidContainer only) | '#e2e8f0' | | tabActiveBackgroundColor | Active tab background | '#3b82f6' | | tabHoverBackgroundColor | Tab hover background | '#cbd5e1' | | tableHoverColor | Table row hover background | '#f3f4f6' | | buttonBgColor | Background for buttons, status badges, and pagination | '#ffffff' |

Styling Inheritance

  • PaidContainer: Styles applied here automatically inherit to all child blocks
  • Individual Blocks: Can override inherited styles or define their own when used standalone
  • Flexible: Mix and match - style globally via PaidContainer or individually per block

Example: Dark Theme

<PaidContainer 
  title="Customer Overview"
  description="Dark theme example"
  defaultActiveTab="payments"
  tabs={[
    {
      id: 'payments',
      label: 'Payments',
      component: <PaidPaymentsTable customerExternalId="customer_123" />
    }
  ]}
  paidStyle={{
    fontFamily: 'Inter',
    primaryColor: '#f9fafb',
    secondaryColor: '#d1d5db',
    containerBackgroundColor: '#1f2937',
    tableBackgroundColor: '#374151',
    tableHeaderBackgroundColor: '#4b5563',
    tabBackgroundColor: '#4b5563',
    tabActiveBackgroundColor: '#3b82f6',
    tabHoverBackgroundColor: '#6b7280',
    tableHoverColor: '#4b5563',
    buttonBgColor: '#6b7280'
  }}
/>

Example: Individual Block Styling

<PaidPaymentsTable 
  customerExternalId="customer_123"
  paidStyle={{
    primaryColor: '#dc2626',
    buttonBgColor: '#fef2f2',
    tableHoverColor: '#fee2e2'
  }}
/>