Contributing to genkitx-posthog
January 16, 2026 · View on GitHub
Thank you for your interest in contributing to genkitx-posthog! This document provides guidelines and instructions for contributing.
Code of Conduct
Please be respectful and considerate in all interactions. We are committed to providing a welcoming and inclusive environment for everyone.
Getting Started
Prerequisites
- Node.js >= 18
- pnpm (recommended) or npm
- A PostHog account for testing (free tier works)
Development Setup
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/genkitx-posthog.git cd genkitx-posthog -
Install dependencies
pnpm install -
Build the project
pnpm build -
Run type checking
pnpm typecheck
Project Structure
genkitx-posthog/
├── src/
│ ├── index.ts # Main entry point and exports
│ ├── exporter.ts # PostHogSpanExporter class
│ ├── types.ts # TypeScript interfaces
│ ├── utils.ts # Helper functions
│ ├── logger.ts # Logger abstraction
│ └── version.ts # Package version constant
├── dist/
│ ├── esm/ # ES Module build output
│ └── cjs/ # CommonJS build output
├── package.json
├── tsconfig.json
├── README.md
├── CHANGELOG.md
├── CONTRIBUTING.md
└── LICENSE
Making Changes
Branch Naming
feat/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoring
Commit Messages
Follow Conventional Commits:
feat(exporter): add support for custom event properties
fix(types): correct ContextInfo interface documentation
docs(readme): add serverless usage example
Code Style
- Use TypeScript strict mode
- Add JSDoc comments for all public APIs
- Keep functions focused and small
- Prefer explicit types over
any - Use meaningful variable names
Testing Your Changes
-
Type check
pnpm typecheck -
Build both ESM and CJS
pnpm build -
Manual testing
Create a test script that imports from the built package:
import { getPostHogProcessor } from './dist/esm/index.js'; const processor = getPostHogProcessor({ apiKey: 'test-key', debug: true, }); console.log('Processor created successfully');
Pull Request Process
-
Create a feature branch
git checkout -b feat/my-feature -
Make your changes
- Write clear, documented code
- Add or update tests if applicable
- Update documentation if needed
-
Commit your changes
git add . git commit -m "feat(scope): description of change" -
Push to your fork
git push origin feat/my-feature -
Create a Pull Request
- Provide a clear description of the changes
- Reference any related issues
- Include testing instructions if applicable
PR Checklist
- Code follows the project's style guidelines
- All type checks pass (
pnpm typecheck) - Both ESM and CJS builds succeed (
pnpm build) - Documentation is updated if needed
- CHANGELOG.md is updated for user-facing changes
Reporting Issues
Bug Reports
Please include:
- genkitx-posthog version
- Node.js version
- Genkit version
- Steps to reproduce
- Expected vs actual behavior
- Any relevant error messages or logs
Feature Requests
Please describe:
- The use case or problem you're trying to solve
- Your proposed solution (if any)
- Any alternatives you've considered
Release Process
Releases are managed by maintainers. The process is:
- Update version in
package.jsonandsrc/version.ts - Update
CHANGELOG.md - Create a git tag
- Publish to npm
Questions?
If you have questions about contributing, feel free to:
- Open a GitHub issue with the "question" label
- Check existing issues and discussions
License
By contributing to genkitx-posthog, you agree that your contributions will be licensed under the Apache-2.0 License.