<authui />

Configuration

Every option Auth UI accepts, as JavaScript or as attributes on <authui-config>.

Call AuthUI.init(config) or place an <authui-config> element. Both write to the same global store, and calling either again replaces the configuration.

Options

OptionAttributeTypeDefaultDescription
endpointendpointstringrequiredAppwrite API endpoint, e.g. https://cloud.appwrite.io/v1.
projectprojectstringrequiredAppwrite project ID.
redirectUrlredirect-urlstringcurrent pageAbsolute URL that email links and OAuth return to. Must be on a registered platform.
successUrlsuccess-urlstringnoneNavigate here after a successful sign in. Without it the page stays put and the modal closes.
methodsmethodsobject / listemail-passwordWhich sign-in methods to show. See below.
signUpsign-upbooleantrueShow the sign-up link and screen.
signUpUrlsign-up-urlstringnoneWhen signUp is false, keep "Don't have an account?" linking to this external URL.
forgotPasswordforgot-passwordbooleantrueShow the Forgot password link on sign-in.
oauthPositionoauth-positiontop / bottomtopPlace OAuth buttons above or below the credential form.
requireNamerequire-namebooleantrueAsk for a display name during sign up.
mfamfabooleantrueLet users enroll and manage MFA from the account screen.
securityPhrasesecurity-phrasebooleantrueRequest a security phrase for magic URL and email OTP and show it in the UI.
oauthScopesnoneobjectnoneExtra scopes per provider, e.g. { google: ["profile"] }.
branding.namenamestringnoneProduct name used in headings.
branding.logologostringnoneLogo URL rendered above the form.
branding.themethemelight / dark / autoautoColour scheme. auto follows an html.dark class, then prefers-color-scheme.
branding.radiusradiusnone / sm / md / lg / xl / fullmdCorner radius scale.
branding.primaryprimaryCSS colourzincPrimary button colour.
branding.primaryForegroundprimary-foregroundCSS colourwhiteText colour on primary buttons.
legal.termsUrlterms-urlstringnoneAdds a Terms of Service link under the form.
legal.privacyUrlprivacy-urlstringnoneAdds a Privacy Policy link under the form.
legal.requireAcceptancerequire-acceptancebooleanfalseOn sign-up, require a checkbox accepting terms/privacy before submit or OAuth.
legal.helpUrlhelp-urlstringnoneHelp / support URL in the legal footer and blocked-user "Contact support" link.
methods.oauthLayoutoauth-layoutstack / accordion / icon / horizontalautoOAuth button layout. Default: stack for 1–2 providers, accordion for 3+. icon / horizontal = icon row.
stringsnoneobjectEnglishOverride any UI string. Applied after the locale pack. See Theming.
localelocaleen / cs / de / frenBuilt-in locale pack. Unknown tags fall back to English. See Theming.
oneTapone-tapbooleanfalseAuto-prompt Google One Tap on signed-out sign-in/sign-up. Requires googleClientId. Soft-fails if GIS is blocked.
googleClientIdgoogle-client-idstringnoneGoogle OAuth Web client ID for One Tap (from Google Cloud). Appwrite does not expose provider client IDs.
identifierFirstidentifier-firstbooleanfalseSign-in shows email then Continue, then password. OAuth stays on step 1. Sign-up keeps email+password together.
previewpreviewbooleanfalsePreview mode: no requests, any credentials accepted, sample data. See Preview mode.

Methods

In JavaScript, methods is an object:

methods: {
  emailPassword: true,
  magicUrl: true,
  emailOtp: false,
  phone: false,
  anonymous: true,
  oauth: ["google", "github", "apple"],
  oauthLayout: "icon", // or "stack" | "accordion" | "horizontal"
}

As an attribute it is a space separated list. OAuth providers are prefixed with oauth::

<authui-config
  methods="email-password magic-url anonymous oauth:google oauth:github"
></authui-config>

Valid tokens: email-password, magic-url, email-otp, phone, anonymous (alias guest), and oauth:<provider> for any provider slug Appwrite accepts, for example google, github, apple, microsoft, discord, facebook, x, linkedin, slack, gitlab, bitbucket, twitch, spotify, notion, dropbox, figma, oidc, okta, auth0.

Every method you enable here must also be enabled in the Appwrite Console. If it is not, Appwrite responds with user_auth_method_unsupported and Auth UI shows "This sign-in method is disabled for this project."

Full example

AuthUI.init({
  endpoint: "https://cloud.appwrite.io/v1",
  project: "acme",
  redirectUrl: "https://acme.com/auth",
  successUrl: "/dashboard",
  methods: { emailPassword: true, emailOtp: true, anonymous: true, oauth: ["google", "github"] },
  signUp: true,
  branding: { name: "Acme", logo: "/logo.svg", theme: "auto", radius: "lg", primary: "#fd366e" },
  legal: { termsUrl: "/terms", privacyUrl: "/privacy", requireAcceptance: true },
  locale: "de",
  oneTap: true,
  googleClientId: "YOUR_GOOGLE_WEB_CLIENT_ID.apps.googleusercontent.com",
  identifierFirst: true,
  strings: { signIn: "Log in", continueAsGuest: "Try without an account" },
});

On this page