Contributing to Trusera SDK
February 12, 2026 · View on GitHub
Thank you for your interest in contributing to the Trusera SDK for JavaScript/TypeScript!
Development Setup
- Clone the repository:
git clone https://github.com/Trusera/trusera-sdk-js.git
cd trusera-sdk-js
- Install dependencies:
npm install
- Build the project:
npm run build
- Run tests:
npm test
Project Structure
trusera-sdk-js/
├── src/
│ ├── index.ts # Main exports
│ ├── client.ts # TruseraClient implementation
│ ├── interceptor.ts # HTTP interceptor
│ ├── events.ts # Event types and utilities
│ └── integrations/
│ └── langchain.ts # LangChain.js integration
├── tests/ # Vitest test files
├── dist/ # Build output (gitignored)
└── package.json
Code Style
- Use TypeScript strict mode
- Follow existing code formatting (we use ESLint)
- Add JSDoc comments for public APIs
- Use modern ES2022+ features (native fetch, crypto.randomUUID)
- Prefer type inference over explicit annotations when clear
Testing
- Write tests for all new features
- Maintain or improve code coverage
- Use Vitest for all tests
- Mock external dependencies (fetch, etc.)
Run tests with:
npm test
npm run test:watch # Watch mode
Pull Request Process
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
npm test && npm run lint) - Commit your changes (
git commit -m 'Add amazing feature') - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request
Commit Message Guidelines
Use clear, descriptive commit messages:
feat: add support for custom event metadatafix: resolve race condition in flush timerdocs: update LangChain integration examplestest: add coverage for interceptor exclude patternsrefactor: simplify event enrichment logic
Release Process
Releases are automated via GitHub Actions:
- Update version in
package.json - Create a git tag:
git tag v0.1.1 - Push tag:
git push origin v0.1.1 - GitHub Actions will build, test, and publish to npm
Questions?
Open an issue or reach out to support@trusera.io
License
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.