Skip to content

feat(nango): add integration.rs with list/get/create/update/delete endpoints#3712

Merged
yujonglee merged 1 commit intomainfrom
devin/1770475085-nango-integration
Feb 7, 2026
Merged

feat(nango): add integration.rs with list/get/create/update/delete endpoints#3712
yujonglee merged 1 commit intomainfrom
devin/1770475085-nango-integration

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 7, 2026

feat(nango): add integration.rs with CRUD endpoints

Summary

Adds integration.rs to crates/nango implementing the 5 Nango Integration API endpoints:

  • list_integrationsGET /integrations
  • get_integrationGET /integrations/{uniqueKey} (with optional include query param for webhook/credentials)
  • create_integrationPOST /integrations
  • update_integrationPATCH /integrations/{uniqueKey}
  • delete_integrationDELETE /integrations/{uniqueKey}

Types added: Integration, IntegrationFull, IntegrationCredentials (tagged enum with OAuth1/OAuth2/TBA/App/Custom variants), CreateIntegrationRequest, UpdateIntegrationRequest.

Follows the same patterns as the existing connection.rs and connect_session.rs modules (uses common_derives!, DataWrapper, parse_response/check_response).

Review & Testing Checklist for Human

  • Verify create_integration return type: the OpenAPI spec says data is an array of Integration, so this returns Vec<Integration>. Confirm this matches actual Nango API behavior — if it actually returns a single object, this will fail to deserialize.
  • Verify include query param encoding for get_integration: currently sent as repeated params (?include=webhook&include=credentials). Confirm Nango accepts this format vs comma-separated.
  • Verify IntegrationCredentials serde tagged enum round-trips correctly against real Nango API responses (especially edge cases like missing optional fields).

Notes

  • No integration tests added (consistent with existing pattern — all API tests in this crate are #[ignore]'d).
  • cargo check -p nango passes. dprint fmt applied.

Link to Devin run: https://app.devin.ai/sessions/26afac3fc8774170b99186e3faa4e03d
Requested by: @yujonglee


Open with Devin

…dpoints

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Feb 7, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit e67e65a
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/698750898fe20a0008913713

@netlify
Copy link

netlify bot commented Feb 7, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit e67e65a
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69875089d65b950008e79d96

@yujonglee yujonglee merged commit e750344 into main Feb 7, 2026
15 of 16 checks passed
@yujonglee yujonglee deleted the devin/1770475085-nango-integration branch February 7, 2026 14:48
Copy link
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +133 to +139
) -> Result<Vec<Integration>, crate::Error> {
let mut url = self.api_base.clone();
url.set_path("/integrations");

let response = self.client.post(url).json(&req).send().await?;
let wrapper: DataWrapper<Vec<Integration>> = parse_response(response).await?;
Ok(wrapper.data)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 create_integration deserializes response as Vec<Integration> but API returns a single object

The create_integration method at line 138 deserializes the response as DataWrapper<Vec<Integration>>, expecting the data field to be an array. However, the Nango POST /integrations API endpoint returns a single integration object in the data field ({ data: { ... } }), not an array.

Root Cause

All other create/mutate endpoints in this crate return a single object wrapped in DataWrapper<T> — for example, create_connect_session at crates/nango/src/connect_session.rs:84 uses DataWrapper<ConnectSession>, and update_integration at line 151 of the same file uses DataWrapper<Integration>. The Nango API consistently returns { data: <single_object> } for create operations.

Using DataWrapper<Vec<Integration>> will cause serde deserialization to fail at runtime with a type mismatch error (expecting array, got object), making create_integration completely non-functional.

Impact: Every call to create_integration will fail with a deserialization error, even when the API request itself succeeds.

Suggested change
) -> Result<Vec<Integration>, crate::Error> {
let mut url = self.api_base.clone();
url.set_path("/integrations");
let response = self.client.post(url).json(&req).send().await?;
let wrapper: DataWrapper<Vec<Integration>> = parse_response(response).await?;
Ok(wrapper.data)
) -> Result<Integration, crate::Error> {
let mut url = self.api_base.clone();
url.set_path("/integrations");
let response = self.client.post(url).json(&req).send().await?;
let wrapper: DataWrapper<Integration> = parse_response(response).await?;
Ok(wrapper.data)
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant