
Setting up Next.js with AWS Amplify
Learn how to set up a Next.js app from scratch and integrate it with AWS Amplify ready to start developing!
storage-browser-demo
, navigate inside, and then create a new application with the following command:npx create-next-app@latest ./ --ts --use-npm
npm install aws-amplify@latest
src/app/providers.tsx
and populate it with the following code:Amplify.configure({})
it’ll just use default values which you can override later.src/app/layout.tsx
to wrap the application with the new Providers component I just created. Only two simple changes are needed. I add the import for the Providers component and use it to wrap the content for each page which will be loaded where {children}
is declared.npm run dev
First, I need to install the Amplify UI React library using:
npm install @aws-amplify/ui-react
src/app/components
where I intend to keep all my future components which is a verycommon way of structuring a Next.js project.AmplifyTest.tsx
with the following code:src/app/page.tsx
to add it to the main page, right at the bottom but before the footer. I need to import the component and then declare it.