import { motion } from 'framer-motion'; import React, { Suspense, useState } from 'react'; import { classNames } from '~/utils/classNames'; import ConnectionDiagnostics from './ConnectionDiagnostics'; import { Button } from '~/components/ui/Button'; import VercelConnection from './VercelConnection'; // Use React.lazy for dynamic imports const GitHubConnection = React.lazy(() => import('./GithubConnection')); const NetlifyConnection = React.lazy(() => import('./NetlifyConnection')); // Loading fallback component const LoadingFallback = () => (
Loading connection...
); export default function ConnectionsTab() { const [isEnvVarsExpanded, setIsEnvVarsExpanded] = useState(false); const [showDiagnostics, setShowDiagnostics] = useState(false); return (
{/* Header */}

Connection Settings

Manage your external service connections and integrations

{/* Diagnostics Tool - Conditionally rendered */} {showDiagnostics && } {/* Environment Variables Info - Collapsible */}
{isEnvVarsExpanded && (

You can configure connections using environment variables in your{' '} .env.local {' '} file:

# GitHub Authentication
VITE_GITHUB_ACCESS_TOKEN=your_token_here
# Optional: Specify token type (defaults to 'classic' if not specified)
VITE_GITHUB_TOKEN_TYPE=classic|fine-grained
# Netlify Authentication
VITE_NETLIFY_ACCESS_TOKEN=your_token_here

Token types:

  • classic - Personal Access Token with{' '} repo, read:org, read:user {' '} scopes
  • fine-grained - Fine-grained token with Repository and Organization access

When set, these variables will be used automatically without requiring manual connection.

)}
{/* Cloudflare Deployment Note - Highly visible */}

Using Cloudflare Pages?

If you're experiencing GitHub connection issues (500 errors) on Cloudflare Pages deployments, you need to configure environment variables in your Cloudflare dashboard:

  1. Go to Cloudflare Pages dashboard → Your project → Settings → Environment variables
  2. Add both of these secrets (Production environment):
    • GITHUB_ACCESS_TOKEN{' '} (server-side API calls)
    • VITE_GITHUB_ACCESS_TOKEN{' '} (client-side access)
  3. Add VITE_GITHUB_TOKEN_TYPE if using fine-grained tokens
  4. Deploy a fresh build after adding these variables
}> }> }>
{/* Additional help text */}

Troubleshooting Tip:

If you're having trouble with connections, try using the troubleshooting tool at the top of this page. It can help diagnose and fix common connection issues.

For persistent issues:

  1. Check your browser console for errors
  2. Verify that your tokens have the correct permissions
  3. Try clearing your browser cache and cookies
  4. Ensure your browser allows third-party cookies if using integrations
); }