mad-kitty-shared

@mad-kitty-shared/funnel-lib (0.2.0)

Published 2026-04-10 13:57:58 +00:00 by techb

Installation

@mad-kitty-shared:registry=
npm install @mad-kitty-shared/funnel-lib@0.2.0
"@mad-kitty-shared/funnel-lib": "0.2.0"

About this package

@mad-kitty-shared/funnel-lib

Shared publishable utilities for all site templates.

Required Env Vars

The funnel app's .env must define these — funnel-lib reads them automatically, agent never passes them as props:

  • VITE_BT_PUBLIC_KEY — Basis Theory public key (required for any checkout)
  • VITE_APPLE_PAY_MERCHANT_ID — optional, enables Apple Pay
  • VITE_APPLE_PAY_DISPLAY_NAME — optional, shown on the Apple Pay sheet
  • VITE_PROJECT_SLUG — used by createFunnelRouter (must match a project slug in the database)

If VITE_BT_PUBLIC_KEY is missing, checkout throws at runtime. If Apple Pay env vars are missing, supportsApplePay() returns false and the method is hidden.

Vite Setup

// vite.config.ts
import { flowRouterPlugin } from '@mad-kitty-shared/funnel-lib/flow-vite-plugin'
import { planPublishPlugin } from '@mad-kitty-shared/funnel-lib/plan-publish-plugin'

export default {
  plugins: [
    flowRouterPlugin(),
    planPublishPlugin({
      apiUrl: 'https://app.example.com/api/trpc',
      projectSlug: process.env.PROJECT_SLUG!,
    }),
  ],
}

Dependencies

Dependencies

ID Version
typescript ^5.7.2
ws ^8.18.3

Development Dependencies

ID Version
@pi-wrapper/trpc workspace:*
@tanstack/react-router ^1.168.10
@trpc/client ^11.16.0
@trpc/server ^11.16.0
@types/node ^22.10.2
@types/react ^19.2.14
@types/react-dom ^19.2.3
@types/ws ^8.5.13
react ^19.2.5
react-dom ^19.2.5
vite ^7.3.1

Peer Dependencies

ID Version
@basis-theory/react-elements ^2.11.1
lucide-react ^1.8.0
vite ^7.0.0
Details
npm
2026-04-10 13:57:58 +00:00
2
63 KiB
Assets (1)
Versions (6) View all
0.2.1 2026-04-10
0.2.0 2026-04-10
0.1.3 2026-04-10
0.1.2 2026-04-10
0.1.1 2026-04-10