Yarn add aws-amplify aws-amplify-react # or npm install aws-amplify aws-amplify-react Install and Configure the AWS Amplify CLI. Next, we'll need to install the AWS Amplify CLI. Npm install -g @aws-amplify/cli. Now that the AWS Amplify CLI is installed, we need to configure it to be able to create resources in our AWS account. AWS Amplify offers use case-centric open source libraries in the Amplify Framework to build cloud powered mobile and web apps. Amplify libraries are powered by AWS services and can be used with new backends created with the Amplify CLI or your existing AWS backend.
Install, update and uninstall the AWS CLI version 1 on macOS using the bundled installer On Linux or macOS, you can use the bundled installer to install version 1 of the AWS Command Line Interface (AWS CLI). The bundled installer includes all dependencies and can be used offline. Apr 24, 2018 by Nader Dabit. How to use AWS Amplify and Angular to Build Cloud Enabled JavaScript Applications. AWS Amplify helps you add functionality like storage, GraphQL, authentication, analytics, pub-sub, and internationalization to your JavaScript applications. While you can integrate AWS Amplify into any JavaScript framework, Angular components have recently been added making it easier than.
AWS Amplify is a set of tools and services that enables mobile and front-end web developers to build secure, scalable full stack applications, powered by AWS. With Amplify, it’s easy to create custom onboarding flows, develop voice-enabled experiences, build AI-powered real-time feeds, launch targeted campaigns, and more. No matter the use case, AWS Amplify helps you develop and release great apps your customers will love. AWS Amplify includes an open-source framework with use-case centric libraries and a powerful toolchain to create and add cloud-based features to your app, and a web hosting service to deploy static web applications.
Benefits
Build innovative apps
With Amplify Libraries, you can mix and match features such as auth, data, AI/ML, or analytics to build custom onboarding flows, real-time chatbots, targeted campaigns, and more, with just a few lines of code. No matter how simple or complex your use case, Amplify gives you the tools to build innovative apps that will delight your customers.
Configure backends in minutes
Automatically set up best-in-class backends for mobile and web apps, such as authentication, storage, or APIs, powered by AWS services such as Amazon S3 or Amazon Cognito. Amplify CLI seamlessly integrates with iOS/Android IDEs and popular web frameworks, providing a guided workflow to personalize the best backend for your app in just a few simple commands.
Deploy and scale with ease
Scale your app with AWS best practices for security, reliability, and global availability built in. Access individual AWS services directly in the AWS console so you can modify them as your business grows. Deploy and host scalable static websites and single page web apps in minutes with a Git-based workflow, using AWS Amplify Console, simply by pointing to your code.
Use cases
Onboarding flows
Create custom onboarding flows allowing users to log in with preferred methods. Features: Auth, UI Components, Analytics
Real-time collaboration
Build real-time feeds, chat, and document sharing to facilitate remote scenarios. Features: Interactions, API, DataStore
AI/ML
Add voice interactions, translations, and image recognition to enable smarter user experiences. Features: Predictions, API, DataStore,
Targeted campaigns
Develop targeted push notifications and campaigns to retain and engage customers. Features: Analytics, Notifications, API
Products & features
Amplify Framework
The Amplify Framework consists of 3 components including libraries, UI components, and a CLI toolchain. Components can be used together or on their own. Organized by use case, Amplify Libraries and UI components are powered by AWS services. They are open source and work with your existing front-end frameworks (React, React Native, Angular, Vue, Ionic) and iOS/Android IDEs. The Amplify Command Line Interface (CLI) is a toolchain to create and maintain serverless backends on AWS. Configure cloud functionality by following a simple, interactive workflow for specifying app capabilities, including the data model and auth requirements.
Static web hosting
AWS Amplify Console is a static web hosting service that accelerates your application release cycle by providing a simple CI/CD workflow for building and deploying static web applications. Simply connect your application's code repository in the console, and changes to your frontend and backend are deployed in a single workflow on every code commit. A fullstack app consists of a frontend built with single page application frameworks such as React, Angular, Vue, or Gatsby and an optional backend built with cloud resources such as GraphQL or REST APIs, file and data storage.
Community
“Trying out AWS Amplify... so far looking like pure magic” @thiagoleychr
“AWS Amplify is an incredible productivity boost. If you're kicking off a new web or mobile app, start here!” @rts_rob
“I'm a huge fan of Amplify hosting, it's AWS best kept secret.” @mikemacd
“Big shout out to #AWS #Amplify for making #continuous #delivery and #release of mobile and web #apps so freaking easy it’s unbelievable. Highly recommended.” @thetestlabsio

“Latest side project, @snapgig, a gig economy marketplace, is up! Happy we utilized the @AWSAmplify CLI/Console, much easier to ramp up on complex backends, perform coordinated deploys, #React/#GraphQL, auth, chat, image upload, etc. Thankful for @dabit3, great tutorials and info!” @ChrisLivdahl
“This has already saved me a good chunk of time. Thanks to fine-grained auth rules in place, I wasn't able to complete a mutation. I updated the rule and the result was immediate! I didn't have to wait for an `amplify push`! 🔥🔥🔥 Thank you @AWSAmplify team!” @mwarger
“What a way to end April! A video went viral, @quiznext installs went up by 1400% and our server did not sweat and no developer burnt midnight oil monitoring servers! Thanks to @AWSMobile, @awscloud and @goserverless! #serverless @AWSAmplify @AWSstartups @awsugblr #edtech” @gprasadholla
“Been using @AWSAmplify in production for few months and have to say that it's pretty much a perfect package. Adding authentication super easy with it, and building a GraphQL API with is such a delight!” @plahteenlahti
“y’all, AWS Amplify is amazing. Set up a severless app to do whatever the heck you want in no time and with minimal elbow grease, then live your life #100DayOfCode #womenwhocode #webdev” @ohcatwhy
“I've said it many times but I'll say it again, God bless @AWSAmplify and Appsync, it makes me dev experience incredible. #aws #webdev #react #serverless” @StelseyLesser
“Digging into AWS Amplify these past few days has really started to shift my perception of how complicated I felt AWS was, into how powerful it can be.” @zslabs
“Hey, @AWSAmplify - Thank you for the love you show for @reactnative (and to some degree for @expo ). Others should follow (@Firebase , @auth0 , etc)” @oriharel
“Holy mother of god, AWS Amplify is fricking awesome. GraphQL endpoint in minutes.” @iamgraem_e
“Oh come on... AWS Amplify is in another league - That thing gives you super powers 🦸♂️” @victorhazbun
Visit the AWS Amplify Features page.
Learn moreInstantly get access to the AWS Free Tier.
Sign upContact our team directly at aws-amplify-customer@amazon.com

by Nader Dabit
AWS Amplify helps you add functionality like storage, GraphQL, authentication, analytics, pub-sub, and internationalization to your JavaScript applications.
While you can integrate AWS Amplify into any JavaScript framework, Angular components have recently been added making it easier than before to get up and running with cloud services in an Angular application.
In this post, we’ll take a look at how to get up and running with AWS Amplify in an Angular application.
Getting Started
Installing dependencies
To get started, we need in install a couple of dependencies: AWS Amplify and AWS Amplify Angular:
Creating a new AWS Mobile Project
If you already have an AWS project you would like to use, you can skip this step. If not, you you will learn how we can use the AWS Mobile Hub to quickly get up and running with AWS services like Amazon Cognito for authentication, Amazon Pinpoint for analytics, AWS AppSync for managed GraphQL, and Amazon S3 for storage.
The next thing we need to do here is install the AWS Mobile CLI:
Will Aws Amplify Work For Macos Windows 7
Next, we will need to configure the AWS Mobile CLI to use your preferred IAM credentials.
If you are new to AWS and would like to see how to set this up for the first time, check out this video.
Now, ourAWS Mobile CLI is ready to go and we can create a new project.
Let’s create a new project that has analytics, storage, and authentication enabled:
After creating your backend, the configuration file is copied to /awsmobilejs/#current-backe
Viewing your project in the AWS Console
Now that you’ve created your project from the CLI, you can view your project in AWS Mobile hub by visiting https://console.aws.amazon.com/mobilehub/home and clicking on the name of your project.
Working in Angular
To import the configuration file to your Angular app, you will need to rename aws_exports.js
to aws_exports.ts
.
To import the configuration file to your Angular app, you will need to rename aws_exports.js
to aws_exports.ts
.
When working with underlying aws-js-sdk
, the “node” package should be included in types compiler option. Make sure that you edit the tsconfig.app.json
file in your source file folder, e.g. src/tsconfig.app.json
.
Importing Amplify
In your root modulesrc/app/app.module.ts
, you can import AWS Amplify modules as following:
The service provider is optional. You can import the core categories normally i.e. import { Analytics } from 'aws-amplify'
or create your own provider. The service provider does some work for you and exposes the categories as methods. The provider also manages and dispatches authentication state changes using observables which you can subscribe to within your components (see below).
Using the AWS Amplify Service
AmplifyService is a provider in your Angular app, and it provides AWS Amplify core categories through dependency injection.
To use AmplifyService with dependency injection, inject it into the constructor of any component or service, anywhere in your application.
Using AWS Amplify Categories
You can access and work directly with AWS Amplify Categories via the built-in service provider:
Usage Example: Subscribe to Authentication State Changes
Import AmplifyService into your component and listen for auth state changes:
View Components
AWS Amplify also provides components that you can use in your Angular view templates, including an authenticator component, a photo picker component, and an Amazon S3 album component.
Authenticator
Authenticator component creates an out-of-the-box signing/sign-up experience for your Angular app. To use Authenticator, just add the amplify-authenticator
directive in your .html view:
Photo Picker
Photo Picker component will render a file upload control that will allow choosing a local image and uploading it to Amazon S3. Once an image is selected, a base64 encoded image preview will be displayed automatically.
To render photo picker in an Angular view, use the amplify-photo-picker
component:
The component will emit two events:
(picked)
- Emitted when an image is selected. The event will contain theFile
object which can be used for upload.(loaded)
- Emitted when an image preview has been rendered and displayed.
Uploading an image
Use onImagePicked(event)
to upload your photo to Amazon S3 using AWS Amplify Storage category:
S3 Album
The Amazon S3 Album component displays a list of images from the connected S3 bucket.
To render the album, use the amplify-s3-album
component in your Angular view:
(selected)
event can be used to retrieve the URL of the clicked image on the list:
Custom Styles
You can use custom styling for AWS Amplify components. Just import your custom styles.css that overrides the default styles which can be found in /node_modules/aws-amplify-angular/theme.css
.
Conclusion
AWS Amplify is open source and actively being developed, and we’d love any feedback and / or issues from customers or users to help us in our future roadmap.
Feel free to check out the docs here, or the GitHub repo here.
Aws Amplify Tutorial
My Name is Nader Dabit . I am a Developer Advocate at AWS Mobile working with projects like AWS AppSync and AWS Amplify, and the founder of React Native Training.