| title | category | slug | parentDocSlug | order | hidden |
|---|---|---|---|---|---|
Contributing |
64cbb5277b5f3c0065d96616 |
opensea-sdk-contributions |
opensea-sdk |
5 |
false |
Contributions are welcome! Please use GitHub issues for suggestions/concerns - if you prefer to express your intentions in code, feel free to submit a pull request.
Prerequisites
- Node.js 20 or higher
- npm or yarn
Initial Setup
Before any development, install the required NPM dependencies:
npm installTypeScript is included as a dev dependency, so there's no need to install it globally.
Build
Lint and build the library into the lib directory:
npm run buildLinting
Check code quality and formatting:
npm run lintFix linting issues automatically:
npm run lint:fixTesting
Run the unit tests:
npm testRun all tests (unit + integration):
npm run test:allNote that integration tests require access to a blockchain RPC provider (via Alchemy) and the OpenSea API. Set up your environment variables in a .env file:
ALCHEMY_API_KEY=your_alchemy_key
OPENSEA_API_KEY=your_opensea_key
WALLET_PRIV_KEY=your_test_wallet_private_key # For integration tests onlyTesting Your Branch Locally
To test your changes in another project:
# In opensea-js repo
npm link
# In the project where you want to test
npm link opensea-jsGenerate Documentation
Generate HTML docs (also available for browsing at https://projectopensea.github.io/opensea-js/):
npm run docs-buildGenerate Markdown docs:
npm run docs-build-mdWhen submitting a pull request:
- Run tests: Ensure all tests pass with
npm test - Run linting: Ensure code passes linting with
npm run lint - Add tests: Add tests for any new functionality
- Update docs: Update relevant documentation if needed
- Follow conventions: Match the existing code style and patterns
- Descriptive commits: Write clear commit messages describing your changes
The project uses:
- TypeScript for type safety
- ESLint for code linting
- Prettier for code formatting
- Husky for pre-commit hooks (automatically runs linting on changed files)
The pre-commit hooks will automatically format your code and run linting checks. If the checks fail, the commit will be rejected until issues are fixed.
opensea-js/
├── src/ # Source code
│ ├── api/ # API client implementation
│ ├── orders/ # Order creation and utilities
│ ├── sdk/ # Core SDK functionality
│ ├── utils/ # Utility functions
│ └── sdk.ts # Main SDK entry point
├── test/ # Test files
│ ├── api/ # API tests
│ ├── fixtures/ # Test fixtures and mocks
│ └── ...
├── developerDocs/ # Developer documentation
└── lib/ # Compiled output (generated)
When adding new features:
- Check existing issues: See if someone has already suggested the feature
- Create an issue first: Discuss the feature before implementing
- Follow SDK patterns: Look at existing code for consistency
- Add comprehensive tests: Include both unit and integration tests where appropriate
- Document your changes: Update relevant documentation files
- Consider backward compatibility: Avoid breaking changes when possible
- Issues: Use GitHub Issues for bug reports and feature requests
- Discussions: Use GitHub Discussions for questions and general discussion
- Documentation: Check the docs for API and SDK guidance