Amplify UI

Authenticator

Authenticator component adds complete authentication flows to your application with minimal boilerplate.

Quick start

Setup with Amplify Gen 2 backend

To get up and running with the Authenticator, follow the Amplify Gen2 quickstart guide.

Setup with Amplify Gen 1 backend

To setup Amplify using the Gen1 CLI, follow the steps below:

Step 1. Configure backend

The Authenticator works seamlessly with the Amplify CLI to automatically work with your backend.

First, update @aws-amplify/cli with npm or yarn if you're using a version before 6.4.0:

npm install -g @aws-amplify/cli@latest
yarn global add @aws-amplify/cli@latest

Now that you have the Amplify CLI installed, you can set up your Amplify project by running amplify init in your project's root directory. Then run amplify add auth and follow the prompts to add authentication to your backend configuration.

If you have an existing backend, run amplify pull to sync your aws-exports.js with your cloud backend.

You should now have an aws-exports.js file in your src/ directory with your latest backend configuration.

Step 2. Install dependencies

npm install @aws-amplify/ui-svelte aws-amplify
yarn add @aws-amplify/ui-svelte aws-amplify

Step 3. Add the Authenticator

The quickest way to get started is by wrapping your application with the Authenticator component. Once an end-user has created an account & signed in, the underlying component is rendered with access to the user.

<script lang="ts">  import { Amplify } from 'aws-amplify';  import { Authenticator } from '@aws-amplify/ui-svelte'  import "@aws-amplify/ui-svelte/styles.css";  import awsconfig from './aws-exports';   Amplify.configure(awsconfig); </script>  
<Authenticator>
{#snippet children({ user, signOut })}
<h1>Hello {user.username}!</h1>
<button onclick={signOut}>Sign Out</button>
{/snippet}
</Authenticator>

Next steps

Amplify open source software, documentation and community are supported by Amazon Web Services.

© 2025 Amazon Web Services, Inc. and its affiliates. All rights reserved. View the site terms and privacy policy.

Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.