Home / Function/ getIntegrationRoute() — supabase Function Reference

getIntegrationRoute() — supabase Function Reference

Architecture documentation for the getIntegrationRoute() function in CreateCommands.utils.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  3ef1900b_e00c_b86c_b40b_74de1f8eeabf["getIntegrationRoute()"]
  7691c069_7dea_faac_d384_4e20dfcccdcd["useCreateCommands()"]
  7691c069_7dea_faac_d384_4e20dfcccdcd -->|calls| 3ef1900b_e00c_b86c_b40b_74de1f8eeabf
  style 3ef1900b_e00c_b86c_b40b_74de1f8eeabf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/App/CommandMenu/CreateCommands.utils.tsx lines 24–58

export function getIntegrationRoute(
  integration: IntegrationDefinition,
  ref: string,
  installedIntegrationIds: Set<string>
): string | null {
  // For wrappers, route to overview with new=true (always available if wrappers feature is enabled)
  if (integration.type === 'wrapper') {
    return `/project/${ref}/integrations/${integration.id}/overview?new=true`
  }

  // For non-wrapper integrations, check if installed and determine route
  if (!installedIntegrationIds.has(integration.id)) {
    return null
  }

  // Map integration IDs to their create routes
  switch (integration.id) {
    case 'vault':
      return `/project/${ref}/integrations/vault/secrets?new=true`
    case 'cron':
      return `/project/${ref}/integrations/cron/jobs?new=true`
    case 'webhooks':
      return `/project/${ref}/integrations/webhooks/webhooks?new=true`
    case 'queues':
      return `/project/${ref}/integrations/queues/queues?new=true`
    default: {
      // For other integrations, try to find a navigation route that's not 'overview'
      const createRoute = integration.navigation?.find((nav) => nav.route !== 'overview')
      if (createRoute) {
        return `/project/${ref}/integrations/${integration.id}/${createRoute.route}?new=true`
      }
      return null
    }
  }
}

Subdomains

Frequently Asked Questions

What does getIntegrationRoute() do?
getIntegrationRoute() is a function in the supabase codebase.
What calls getIntegrationRoute()?
getIntegrationRoute() is called by 1 function(s): useCreateCommands.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free