DocsLocal
Local
Test PayKit locally without external dependencies.
The Local provider creates a complete payment simulation environment on your machine. Your backend logic lives in a single configurable file, and the development server provides a hosted checkout experience.
Quick Start
Install the Local provider:
Setup
Method 1: Environment Variables
Method 2: Direct Configuration
CLI Setup
Initialize PayKit in your project:
This creates a .paykit/config.json
file where you'll define your payment logic.
Start the development server:
The checkout interface will be available at http://localhost:3001
.
Configuration
Edit .paykit/config.json
to define your payment flows:
Basic Usage
Webhook Setup
The Local provider uses plugins to handle webhooks differently from other providers.
Next.js API Route
Vite.js
Development Workflow
- Run
npx @paykit-sdk/cli init
to create your config - Edit
.paykit/config.json
with your products, customers, and subscriptions - Start the dev server with
npx @paykit-sdk/cli dev
- Implement your API route using the plugin helpers
- Test payment flows through the hosted checkout interface
Environment Variables
Provider Metadata
Local provider supports basic configuration: