<CreateOrganization />

Create organization form

<CreateOrganization /> creates a new organization in Convex Better Auth. It handles name and slug input, optional logo upload, loading states, success callbacks, and redirect behavior after creation.

It is used inside <OrganizationSwitcher />, but you can also render it on a dedicated onboarding or workspace creation page.


Quick start


What it does

  • Creates the organization through the Convex createOrganization mutation.
  • Generates a slug from the organization name while still allowing manual edits.
  • Uploads and crops logos before saving them to Convex storage.
  • Shows unauthenticated and loading states instead of rendering a broken form.
  • Redirects after creation when redirectTo or a redirectTo query param is present.
  • Calls success callbacks so dialogs can close and parent UI can refresh.

Props

  • onSuccessfulCreate – called after the organization is created. Useful for closing a dialog.
  • redirectTo – optional destination after creation. If omitted, the component also checks the current redirectTo query param.

Redirect behavior

For onboarding flows, use /active-organization as a stable destination. After the organization is active, the route resolves to the current organization’s slug.

If the user creates an organization while already on an organization-scoped route, the component can update the URL so the route stays in the active organization context.


  • <OrganizationSwitcher /> – includes this form in its create organization dialog.
  • <OrganizationProfile /> – manages an existing organization.
  • <OrganizationProfileHost /> – mounts the organization settings dialog.