Skip to content

feat: add 5 end-to-end provider examples#1

Merged
khaliqgant merged 3 commits intomainfrom
feat/examples
Mar 29, 2026
Merged

feat: add 5 end-to-end provider examples#1
khaliqgant merged 3 commits intomainfrom
feat/examples

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Mar 29, 2026

Examples

  1. Nango GitHub proxy — proxy without baseUrl (optional now), override pattern
  2. Composio proxy — toolkit resolution from connected account
  3. Provider + adapter — NangoProvider + GitHubAdapter wired together (key integration)
  4. Multi-provider — Nango + Composio + stubs for all others
  5. Health & connections — health checks, connection management

Shows the new optional baseUrl pattern throughout.


Open with Devin

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@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 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment on lines +63 to +79
const mockWebhookPayload = {
type: "forward",
connectionId: CONNECTION_ID,
providerConfigKey: "github",
payload: {
action: "opened",
pull_request: {
number: 99,
title: "Add relayfile examples",
html_url: "https://github.com/acme/api/pull/99",
user: { login: "agent-bot" },
},
repository: {
full_name: "acme/api",
},
},
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Mock webhook payload missing required fields causes example 03 to crash at handleWebhook

The mock forward-webhook payload at examples/03-provider-with-adapter/index.ts:63-79 is missing the fields that extractForwardMetadata (packages/nango/src/webhook.ts:98-154) requires. The inner payload object only has action, pull_request, and repository, but the normalizer looks for objectType/object_type/resource/entity (for object type), objectId/object_id/id (for object ID), and eventType/event_type/topic/event (for event type). Since none of these are present, resolveForwardEventType returns undefined, causing a NangoWebhookError: "Forwarded Nango webhook payload is missing explicit event metadata" to be thrown at webhook.ts:124-129. Because the handleWebhook call at line 91 is not inside a try-catch, the entire example crashes immediately, never reaching Steps 2–4. The README states "The example uses mock webhook data so it runs without real GitHub events" implying it should work through the webhook normalization step.

Required fields for the inner payload

The mock payload needs fields like objectType (e.g. "pull_request"), objectId or id (e.g. 99), and either eventType or event/topic (e.g. "pull_request.opened") in the nested payload object for extractForwardMetadata to succeed.

Suggested change
const mockWebhookPayload = {
type: "forward",
connectionId: CONNECTION_ID,
providerConfigKey: "github",
payload: {
action: "opened",
pull_request: {
number: 99,
title: "Add relayfile examples",
html_url: "https://github.com/acme/api/pull/99",
user: { login: "agent-bot" },
},
repository: {
full_name: "acme/api",
},
},
};
const mockWebhookPayload = {
type: "forward",
connectionId: CONNECTION_ID,
providerConfigKey: "github",
payload: {
action: "opened",
objectType: "pull_request",
objectId: "99",
event: "pull_request",
pull_request: {
number: 99,
title: "Add relayfile examples",
html_url: "https://github.com/acme/api/pull/99",
user: { login: "agent-bot" },
},
repository: {
full_name: "acme/api",
},
},
};
Open in Devin Review

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

devin-ai-integration[bot]

This comment was marked as resolved.

khaliqgant and others added 3 commits March 29, 2026 22:32
Five runnable TypeScript examples covering the core provider patterns:
- Nango GitHub proxy with optional baseUrl override
- Composio proxy with toolkit/action resolution
- Provider + Adapter webhook→writeback flow (core pattern)
- Multi-provider registry in a single app
- Health checks and connection listing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit 39af41c into main Mar 29, 2026
1 check passed
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