Generate integrations with AI
Guide on how to best use AI to build custom integrations fast.
Building custom integrations for Nango is much faster when using AI tools. This guide shows you how to leverage Cursor or Claude Code to build high-quality integrations quickly.
Demo video: generate integrations with Cursor
Overview of recommended tools
We recommend using one of these AI-powered development environments:
- Cursor with Agent Mode
- Claude Code (Anthropic’s official CLI tool)
Both tools understand Nango’s architecture and can help you build integrations following best practices.
Prerequisites
Before starting, ensure you have:
- Working Nango integrations folder: Either an existing
nango-integrations
directory or runnango init
to create one - Environment setup: Your
.env
file configured with development environment secret (found in dashboard settings) - Provider configured: The provider should already be configured in your Nango dashboard
- Test connection: At least one working test connection for the provider you’re integrating
Step-by-step process
1. Set up your development environment
First, make sure your Nango project is properly initialized:
2. Craft effective prompts
When working with your AI assistant, provide clear, specific prompts:
Example prompt structure:
3. Key prompt tips
- Be specific about the provider and integration name - this helps the AI understand the context
- Specify sync vs action - clearly state whether you’re building a sync (continuous data synchronization) or action (one-time operation)
- Specify data models - clearly describe what data you want to be synced or returned and its structure
- Include field mapping details - specify how API fields should map to your desired output schema and any transformations needed
- Provide the test connection ID - enables the AI to run
nango dryrun
for testing - Include API documentation links - if available, provide links to the provider’s API docs
4. Iterative Development
Work with your AI assistant iteratively:
- Start with basic data fetching
- Test with
nango dryrun
- Add data transformation and validation
- Implement error handling
- Add pagination if needed
- Final testing and cleanup
Common pitfalls and checklist
When using AI to build integrations, watch out for these common issues:
❌ API Knowledge Gaps
- Problem: AI may not know specific API endpoints/parameters or may use non-existent endpoints
- Solution: Provide API documentation and verify endpoint usage against the actual API docs
- Watch for: Endpoints that don’t exist in the provider’s API, client-side filtering instead of using proper query parameters
❌ Code Artifacts
- Problem: Leftover debugging code or incomplete implementations
- Solution: Review generated code thoroughly and ask AI to clean up artifacts
❌ Missing Validation
- Problem: No input validation or data type checking
- Solution: Explicitly ask for validation of API responses and input parameters
❌ Poor Error Handling
- Problem: Basic or missing error handling for API failures or missing data
- Solution: Request comprehensive error handling for common API error scenarios
✅ Quality checklist
Before finalizing your integration, verify:
- API endpoints are correctly implemented
- Proper query parameters are used
- All debugging code and artifacts are removed
- Input and output validation is implemented
- Error handling covers common failure scenarios
- Pagination is implemented correctly
- Data models match the expected schema
-
nango dryrun
passes successfully and without errors
When to restart with fresh context
Consider starting with a fresh AI context when:
- The conversation becomes too long and the AI loses track of requirements
- Multiple failed attempts have cluttered the context
- The AI starts suggesting irrelevant or incorrect solutions
Save working code snippets before restarting, so you can quickly provide context to the fresh session.
Best practices for AI-assisted development
- Start simple: Begin with basic functionality and iterate
- Test frequently: Ensure the agent is running
nango dryrun
after each significant change - Provide feedback: Give clear feedback on what works and what doesn’t
- Stay focused: Keep prompts focused on specific tasks
- Review thoroughly: Always review AI-generated code before deploying
By following this guide and leveraging AI assistance effectively, you can build robust Nango integrations much faster than traditional development approaches.