π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
NocoDB Integrations
This monorepo contains the integration framework and various integrations for NocoDB.
Structure
nocodb-integrations/
βββ core/ # Core integration framework
βββ packages/
β βββ auth-github/ # GitHub auth integration
β βββ ai-openai/ # OpenAI integration
β βββ ... # Other integrations
Development
Prerequisites
- Node.js >= 22
- pnpm >= 9
Setup
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
Testing
The repository includes a comprehensive testing setup:
# Run tests for all packages
pnpm test
# Run tests with coverage for all packages
pnpm test:coverage
# Run tests for a specific package
pnpm --filter @noco-integrations/openai-ai test
Each integration package contains its own tests in a tests/ directory. All tests use Vitest as the testing framework.
Creating a New Integration
Alternatively, you can create a new package manually:
- Create a new package in the
packagesdirectory - Follow the integration package structure:
provider-type/ βββ src/ β βββ index.ts # Main entry point β βββ manifest.ts # Integration metadata β βββ form.ts # Configuration form β βββ integration.ts # Integration implementation βββ tests/ # Tests for the integration βββ package.json βββ tsconfig.json βββ README.md
3. Implement the required interfaces from `@noco-integrations/core`
4. Add tests for your integration
## Sync Integration Standardization Guidelines
This document outlines the standards and best practices for creating and maintaining sync integrations in the NocoDB integrations monorepo.
### Structure
Every sync integration should follow this structure:
packages/[provider]-sync/ βββ package.json # Dependencies and metadata βββ tsconfig.json # TypeScript configuration βββ src/ βββ index.ts # Integration entry point βββ integration.ts # Implementation class βββ form.ts # Configuration UI definition βββ manifest.ts # Integration metadata
### Implementation Standards
1. **Class Structure**
- Extend the `SyncIntegration` abstract class
- Implement all required methods:
- `getDestinationSchema()`
- `fetchData()`
- `formatData()`
- `getIncrementalKey()`
2. **Error Handling**
- Use try/catch blocks for all API calls
- Log errors with descriptive messages
- Include provider-specific error codes where possible
3. **Pagination**
- Implement proper pagination for all API endpoints
- Use provider-specific pagination mechanisms
4. **Data Mapping**
- Follow consistent patterns when mapping provider data to NocoDB schema
- Use helper methods for complex mappings
5. **Authentication**
- Use auth integrations correctly
- Handle token refresh when needed
### Code Style
1. **Naming Conventions**
- Class name: `[Provider]SyncIntegration`
- File names: lowercase with hyphens
- Config interface: `[Provider]SyncPayload`
2. **Logging**
- Use the built-in `this.log()` method
- Format log messages as `[Provider Sync] Message`
3. **Comments**
- Document complex logic or workarounds
### Configuration Form
1. **Required Fields**
- Authentication integration selection
- Provider-specific identifiers (repo, project, etc.)
2. **Optional Fields**
- Data filtering options (e.g., include closed items)
- Sync frequency settings
### Testing
1. **Manual Testing**
- Test with real provider accounts
- Verify incremental sync works correctly
2. **Automated Testing**
- Create unit tests for data mapping functions
- Use mocks for API responses