Thank you for your interest in contributing. This document explains how to set up the project, the development workflow, and expectations for pull requests.
- Node.js 18.18+ (Next.js 15 requires Node 18 or newer)
- A package manager: npm, pnpm, or yarn
-
Fork the repository and clone your fork.
-
Install dependencies:
- npm:
npm ci(ornpm install) - pnpm:
pnpm install - yarn:
yarn
- npm:
-
Copy .env.example to .env and fill the values
cp .env.example .env -
Start the dev server:
- npm:
npm run dev - pnpm:
pnpm dev - yarn:
yarn dev
- npm:
-
Open http://localhost:3000 in your browser.
src/app/(home): Landing and marketing pagessrc/app/docs: Documentation layout and routingcontent/docs: MDX content for documentationsrc/app/api/search/route.ts: Search API powered by Fumadocs sourcesrc/app/api/chat/route.ts: Chat API using Inkeepsrc/components/ui: Reusable UI primitives (shadcn-style components)
- Create component source:
- Component:
src/registry/billingsdk/<component>.tsx - Demo:
src/registry/billingsdk/demo/<component>-demo.tsx
- Component:
- Update
registry.jsonfollowing the shadcn registry docs. - Build registry JSON:
- Run:
npx shadcn@latest build - Output: generated files appear under
public/r/*.json
- Run:
- Consume in another project:
npx shadcn@latest add http://localhost:3000/r/<component>.json
- Build transport templates:
node packages/cli/dist/index.js build- Outputs
public/tr/*.jsonfrompackages/templates/registry.json
- Point the CLI to local transports (same repo root):
BILLINGSDK_REGISTRY_BASE=file://$PWD/public/tr \ node packages/cli/dist/index.js init --framework express --provider dodopayments --yes --cwd /tmp/billingsdk-test- Alternatively, run the site on localhost and link the CLI:
npm run dev(serveshttp://localhost:3000/tr)cd packages/cli && npm run build && npm link- In another project:
BILLINGSDK_REGISTRY_BASE=http://localhost:3000/tr billingsdk init --framework express --provider dodopayments --yes
- Flags supported by
init:--framework <nextjs|express|react|fastify|hono>--provider <dodopayments|stripe>(Stripe valid for Express/Hono)--yesnon-interactive--no-installskip dependency installation--registry-base <url>override transport base (env:BILLINGSDK_REGISTRY_BASE)--cwd <path>run against a different directory--forceoverwrite files without prompt--dry-runprint actions without writing files or installing--verboseshow registry URL, placement, and actions--package-manager <npm|pnpm|yarn|bun>choose installer
- Quick smoke test script idea:
rm -rf /tmp/billingsdk-test && mkdir -p /tmp/billingsdk-test && npm init -y -w /tmp/billingsdk-test- Run the
initcommand with--yesas above
- Use Tailwind utilities and existing theme tokens; avoid hard-coded color values.
- Keep functions small and focused; use meaningful names.
- Match existing code style and formatting. If unsure, align to nearby code.
- Avoid introducing unused dependencies.
dev: start Next.js dev serverbuild: production buildstart: run production server
- Add or edit MDX docs under
content/docs. - Ensure frontmatter and structure follow existing examples.
- For new components or demos, keep examples minimal and focused.
- Create a feature branch from
main. - Make your changes with small, focused commits.
- Verify locally:
npm run buildcompletes successfullynpm run devstarts without runtime or TypeScript errors- Relevant routes (home, docs, affected pages) render as expected
- Open a pull request:
- Provide a clear title and description of the change and motivation
- Include screenshots for UI changes when applicable
- Note any migrations or breaking changes
- Keep PRs small and self-contained when possible.
- Address review feedback with follow-up commits (avoid force-pushing unless necessary).
- If a discussion stalls, summarize options and propose a decision to move forward.
When filing an issue, include:
- What you expected to happen vs. what happened
- Steps to reproduce
- Environment details (OS, Node version, browser)
- Logs or stack traces if available
Unless otherwise stated, contributions to this repository are made under the same license as the repository.