PayKit is an embedded billing framework for TypeScript apps. It runs inside the user's app, uses their database, and provides APIs for plans, subscriptions, entitlements, and usage billing.
PayKit should feel like application code, not a hosted billing platform or a thin provider SDK wrapper. Keep provider-specific details behind typed, composable APIs.
- Follow the repository's formatter, linter, and TypeScript config.
- Use
import typefor type-only imports. - Prefer functions and plain objects over classes.
- Keep comments rare and about code logic. Do not add unnecessary separator comments.
- Prefer keeping code comments single line over multi line, exception for JSDoc
- Prefer adding JSDoc on most functions in the library core, and on some object properties mainly if api is used in many places, or user-facing
- Keep JSDoc strings short and useful
- while writing JSDoc follow it's standards, such as tags
- When asked opinion questions, answer only. Do not edit code unless explicitly asked.
- Never commit, push, or run database migrations unless explicitly asked.
- When generating migrations, always provide a name.
- Never edit past migrations; create a new migration instead.
- Never run "deploy" scripts to test anything, only if explicitly asked
- NEVER EVER publish or release packages yourself, ask double confirmation