# Contributing to Social Bridge SDK First off, thank you for considering contributing — this project grows through community input, especially as we work toward supporting more platforms. ## How to Contribute 1. **Fork** the repository and create your branch from `main`. 2. **Install dependencies**: `npm install`. 3. **Make your changes** inside `src/`. Please keep the existing architecture: - One file per platform inside `src/platforms/`. - Shared types live in `src/types/index.ts`. - Shared helpers (error normalization, validation) live in `src/utils/`. 4. **Build and typecheck** before submitting: `npm run build`. 5. **Commit** using clear, descriptive messages (e.g. `feat: add TikTok publisher`, `fix: handle LinkedIn 401 errors`). 6. **Open a Pull Request** describing what you changed and why. ## Adding a New Platform If you'd like to help with one of the roadmap items (X/Twitter, YouTube Shorts), the general pattern is: 1. Create `src/platforms/.ts` exporting a `publishTo()` function. 2. Follow the existing signature style: accept `(content: PostContent, credentials, http?)` and return a `Promise`. 3. Wrap all logic in `try/catch` and use `normalizeError()` from `src/utils/errorHandler.ts` for consistent error shapes. 4. Read credentials from the passed-in config first, falling back to `process.env`. 5. Register the new method on the `SocialBridge` class in `src/index.ts`, and add it to the `publishToAll()` dispatch map. 6. Update the `PlatformName` union type and `SocialBridgeConfig` interface in `src/types/index.ts`. 7. Document the new method and required environment variables in the README. ## Code Style - TypeScript, ES Modules, `strict` mode — please keep type-safety intact. - Prefer clear, explanatory comments over clever one-liners. - No hardcoded secrets, ever. All credentials must flow through config or `process.env`. ## Reporting Bugs / Requesting Features Please open an issue with: - A clear description of the problem or request. - Steps to reproduce (for bugs), including the platform involved. - Expected vs. actual behavior. ## Code of Conduct Be respectful and constructive. We're all here to build something useful for the developer community.