Thank you for considering contributing to Experience SDK! This document outlines the process for contributing and the standards we follow.
- Fork and clone the repository
- Install dependencies:
pnpm install - Create a branch:
git checkout -b feature/my-feature - Make your changes
- Test your changes:
pnpm test - Ensure code quality:
pnpm lint && pnpm typecheck
We follow Conventional Commits for commit messages. This is enforced using commitlint.
Format: type(scope): subject
Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Changes that don't affect code meaning (formatting, etc.)refactor: Code changes that neither fix bugs nor add featuresperf: Performance improvementstest: Adding or fixing testschore: Changes to build process or auxiliary tools
Examples:
feat(core): add explainability trace to decisions
fix(plugins): correct frequency capping logic
docs: update API examples in README
- Update the README.md if needed with details of changes to the interface.
- Add a changeset to document your changes:
pnpm changeset - Create a pull request to the
mainbranch. - The PR will be reviewed and merged if it meets our standards.
experience-sdk/
├── packages/
│ ├── core/ # Main runtime (@prosdevlab/experience-sdk)
│ └── plugins/ # Official plugins (@prosdevlab/experience-sdk-plugins)
├── demo/ # Demo site
└── notes/ # Planning & architecture docs
- Create a new directory in the
packagesfolder. - Create a
package.json,tsconfig.json, andtsup.config.ts. - Add the package to relevant workspace configurations.
- Update dependencies if needed.
Plugins should follow the sdk-kit plugin pattern:
import type { PluginFunction } from '@lytics/sdk-kit';
export const myPlugin: PluginFunction = (plugin, instance, config) => {
plugin.ns('my-plugin');
plugin.defaults({
myPlugin: {
enabled: true,
// ... config
}
});
plugin.expose({
myPlugin: {
// ... public API
}
});
instance.on('sdk:ready', () => {
// Initialize
});
};See notes/IMPLEMENTATION_PLAN.md for detailed plugin patterns.
- Write tests for all new features and bug fixes.
- Run existing tests to ensure your changes don't break existing functionality.
- Aim for 80%+ test coverage.
- Use Vitest for all tests.
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run with coverage
pnpm test:coverageWe use Biome for linting and formatting:
# Check code quality
pnpm lint
# Format code
pnpm formatAll code must pass linting and typechecking before being merged.
We use Changesets to manage versions and generate changelogs.
After making changes:
- Run
pnpm changeset - Follow the prompts to describe your changes
- Commit the generated changeset file
If you have any questions, please open an issue or discussion in the repository.
By contributing, you agree that your contributions will be licensed under the MIT License.