Home / Function/ Introduction() — supabase Function Reference

Introduction() — supabase Function Reference

Architecture documentation for the Introduction() function in Introduction.tsx from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/studio/components/interfaces/Docs/Introduction.tsx lines 14–52

export default function Introduction({ selectedLang }: Props) {
  const { ref: projectRef } = useParams()

  const { data: settings } = useProjectSettingsV2Query({ projectRef })
  const { data: config, isSuccess } = useProjectPostgrestConfigQuery({ projectRef })

  const protocol = settings?.app_config?.protocol ?? 'https'
  const hostEndpoint = settings?.app_config?.endpoint
  const endpoint = `${protocol}://${hostEndpoint ?? ''}`

  const isPublicSchemaEnabled = config?.db_schema
    .split(',')
    .map((name) => name.trim())
    .includes('public')

  return (
    <>
      <h2 className="doc-heading">Connect to your project</h2>
      <div className="doc-section">
        <article className="code-column text-foreground">
          <p>
            All projects have a RESTful endpoint that you can use with your project's API key to
            query and manage your database. These can be obtained from the{' '}
            <InlineLink href={`/project/${projectRef}/settings/api`}>API settings</InlineLink>.
          </p>
          <p>
            You can initialize a new Supabase client using the <code>createClient()</code> method.
            The Supabase client is your entrypoint to the rest of the Supabase functionality and is
            the easiest way to interact with everything we offer within the Supabase ecosystem.
          </p>
        </article>
        <article className="code flex flex-col gap-y-2">
          <CodeSnippet selectedLang={selectedLang} snippet={Snippets.init(endpoint)} />
          {isSuccess && !isPublicSchemaEnabled && <PublicSchemaNotEnabledAlert />}
        </article>
      </div>
    </>
  )
}

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free