Build a Native Integration
Conduit operates a Marketplace where chain admins can add apps and tooling to their chain directly from the Conduit platform. By listing your product as a native integration, you get direct distribution to hundreds of Conduit chains: admins install your integration with one click, and manage its settings through your interface.
During installation, Conduit sends your service a webhook event. Use it to start indexing, deploy smart contracts, or request additional configuration from the customer.
The API is subject to change as Conduit collects feedback from partners.
Integration lifecycle
- You give Conduit a webhook URL, and Conduit shares an integration ID and a secret with you.
- When a customer installs your integration, Conduit sends an
IntegrationEventwithevent=INSTALLEDto your webhook URL, with the secret as a header so you can verify the request came from Conduit. - If your integration links accounts, Conduit starts the OAuth 2.0 flow before
sending the event, then sends the same event with an
Authorization: Bearer <TOKEN>header. - You respond with the installation status: installed, installing, or configuration required.
- When the customer uninstalls the integration, Conduit sends an
IntegrationEventwithevent=UNINSTALLED.
List your integration
Conduit currently curates all integrations. To get your integration listed, provide:
- Name of the integration
- Logo to display to customers
- Banner image to display before the description
- Short blurb that describes the integration in one sentence
- Long description in Markdown for the integration details page
- Author of the integration
- Category of the integration: DevTools, indexers, oracles, and so on
- Website URL
- Docs URL
- (Optional) OAuth 2.0 endpoint to link accounts
Conduit shares with you:
- An integration ID, used for the OAuth login flow
- An integration secret, included in API calls and the OAuth login flow
Verify webhook requests
Conduit authenticates webhook requests in one of two ways, depending on how your integration is configured:
- Secret header (default): each request includes the integration secret in
the
X-Conduit-Integration-Secretheader. Compare it against your secret to confirm the request came from Conduit. - Signature: if a signature secret is configured for your integration,
each request instead includes the integration secret in the
X-Conduit-Integration-Api-Keyheader and a signature in theX-Conduit-Integration-Signature-256header. The signature issha256=followed by the hex-encoded hash-based message authentication code (HMAC), computed with SHA-256 over the raw request body and keyed with your signature secret. Compute the HMAC over the body exactly as received, before any JSON parsing.
If your integration links accounts, requests also include an
Authorization: Bearer <TOKEN> header with the OAuth access token.
Event payload
The event payload is a JSON object with the following fields. Conduit omits fields with empty or default values from the JSON, so treat missing fields as unset.
Fields other than event and id are optional and may or may not be present.
Conduit might add new fields in the future, so make sure your JSON processing
handles unknown fields.
Here’s an example installation event:
The uninstall event contains the network slug, the installation ID, and the
chain ID. Conduit sends NETWORK_DELETED instead of UNINSTALLED when the
customer deletes the network itself:
Respond to events
Your webhook responds to each event with a JSON object with the following fields:
Conduit validates your response:
- A
CONFIGURATION_REQUIREDresponse must includeconfigure_integration_link. - A
failure_reasonis only accepted with statusFAILED_TO_INSTALL. - For
UNINSTALLEDandNETWORK_DELETEDevents, respond with statusUNINSTALLINGorNOT_INSTALLED. - If your webhook returns HTTP 200 with a body Conduit can’t parse, Conduit
assumes a default status:
INSTALLINGfor install events andUNINSTALLINGfor uninstall events.
If the integration installed successfully, reply with:
If the integration requires additional configuration, for example if the customer needs to deposit gas fees before you deploy smart contracts, reply with:
Conduit redirects the customer to the configuration page on your website where they complete the setup. Conduit also shows the configuration link permanently on the integration page, in case the customer closes the window.
If the integration needs additional time to process, for example if you’re indexing the chain logs, reply with:
When the installation completes, POST the installation payload to
https://api.conduit.xyz/public/integrations/status/update with your
integration secret in the X-Conduit-Integration-Secret header. The id is
the network slug from the event:
Fetch network information
You can fetch a network’s information at any time, for example if you weren’t
able to process an installation event. Send an unauthenticated GET request to
https://api.conduit.xyz/public/integrations/network/:network_slug, where
:network_slug is the id from the event:
The response follows the same schema as the event payload, with two serialization differences:
- Field names use camelCase (
chainId,nativeCurrency,logoUrl) instead of snake_case. - Empty and default-valued fields are included instead of omitted, so expect
empty strings, empty objects, and
falsebooleans. Theeventfield is alwaysDEFAULT_EVENT_TYPE, andinstallationIdis empty because the response describes the network, not an installation.
Link accounts with OAuth 2.0
If your integration needs to link Conduit customers to accounts in your service, implement the OAuth 2.0 authorization code flow:
User authorization
Conduit redirects the customer to your login page, where they sign in and authorize the app. After authorization, your service redirects back to Conduit’s callback URL with an authorization code.
TypeScript SDK
The @conduitxyz/integrations
SDK provides TypeScript types and helpers for handling integration events:
The SDK exports:
IntegrationEvent: a discriminated union type for incoming webhook events, narrowed by theeventfield.IntegrationEventResponse,InstallationArtifact, andconstructIntegrationEventResponse: a discriminated union type and helper for building type-safe responses, narrowed by thestatusfield.SECRET_HEADER_NAME,isValidSecret, andassertValidSecret: theX-Conduit-Integration-Secretheader name and helpers for validating it.API_KEY_HEADER_NAME,SIGNATURE_HEADER_NAME,isValidSignature, andassertValidSignature: header names and helpers for verifying HMAC-signed webhooks.- Constants:
EventType,IntegrationStatus,StackType, andNetworkType.
Deploy a webhook handler on Cloudflare Workers
The fastest way to stand up a webhook endpoint is a Cloudflare Worker. Copy this minimal project, deploy it with Wrangler, and you have a public HTTPS endpoint that Conduit can send events to. The SDK secret and signature helpers use the Web Crypto API, so they run on Workers without extra configuration.
Write the handler
Create src/index.ts:
If your integration uses signature verification instead of the secret
header, read the raw body before parsing and verify it with
isValidSignature: