AWS Amplify is a JavaScript library for frontend and mobile developers building cloud-enabled applicationsNote aws-amplify 6 has been released. If you are looking for upgrade guidance click here
AWS Amplify provides a declarative and easy-to-use interface across different categories of cloud operations. AWS Amplify goes well with any JavaScript based frontend workflow and React Native for mobile developers.
Our default implementation works with Amazon Web Services (AWS), but AWS Amplify is designed to be open and pluggable for any custom backend or service.
AWS Amplify is available as aws-amplify
on npm.
To get started pick your platform from our Getting Started home page
Amplify 6.x.x has breaking changes. Please see the breaking changes on our migration guide Amplify 5.x.x has breaking changes. Please see the breaking changes below:If you are using default exports from any Amplify package, then you will need to migrate to using named exports. For example:
- import Amplify from 'aws-amplify'; + import { Amplify } from 'aws-amplify' - import Analytics from '@aws-amplify/analytics'; + import { Analytics } from '@aws-amplify/analytics'; // or better + import { Analytics } from 'aws-amplify'; - import Storage from '@aws-amplify/storage'; + import { Storage } from '@aws-amplify/storage'; // or better + import { Storage } from 'aws-amplify';
Datastore predicate syntax has changed, impacting the DataStore.query
, DataStore.save
, DataStore.delete
, and DataStore.observe
interfaces. For example:
- await DataStore.delete(Post, (post) => post.status('eq', PostStatus.INACTIVE)); + await DataStore.delete(Post, (post) => post.status.eq(PostStatus.INACTIVE)); - await DataStore.query(Post, p => p.and( p => [p.title('eq', 'Amplify Getting Started Guide'), p.score('gt', 8)])); + await DataStore.query(Post, p => p.and( p => [p.title.eq('Amplify Getting Started Guide'), p.score.gt(8)]));
npm install -g @aws-amplify/cli
amplify codegen models
Storage.list
has changed the name of the maxKeys
parameter to pageSize
and has a new return type that contains the results list. For example:
- const photos = await Storage.list('photos/', { maxKeys: 100 }); - const { key } = photos[0]; + const photos = await Storage.list('photos/', { pageSize: 100 }); + const { key } = photos.results[0];
Storage.put
with resumable turned on has changed the key to no longer include the bucket name. For example:
- let uploadedObjectKey; - Storage.put(file.name, file, { - resumable: true, - // Necessary to parse the bucket name out to work with the key - completeCallback: (obj) => uploadedObjectKey = obj.key.substring( obj.key.indexOf("/") + 1 ) - } + let uploadedObjectKey; + Storage.put(file.name, file, { + resumable: true, + completeCallback: (obj) => uploadedObjectKey = obj.key + }
Analytics.record
no longer accepts string as input. For example:
- Analytics.record('my example event'); + Analytics.record({ name: 'my example event' });
The JS
export has been removed from @aws-amplify/core
in favor of exporting the functions it contained.
Any calls to Amplify.Auth
, Amplify.Cache
, and Amplify.ServiceWorker
are no longer supported. Instead, your code should use the named exports. For example:
- import { Amplify } from 'aws-amplify'; - Amplify.configure(...); - // ... - Amplify.Auth.signIn(...); + import { Amplify, Auth } from 'aws-amplify'; + Amplify.configure(...); + // ... + Auth.signIn(...);
@react-native-community/netinfo
@react-native-async-storage/async-storage
// React Native
yarn add aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage
npx pod-install
// Expo
yarn add aws-amplify @react-native-community/netinfo @react-native-async-storage/async-storage
Amplify 3.x.x has breaking changes. Please see the breaking changes below:
AWS.credentials
and AWS.config
don’t exist anymore in Amplify JavaScript.
aws-sdk@2.x
has been removed from Amplify@3.x.x
in favor of version 3 of aws-sdk-js. We recommend to migrate to aws-sdk-js-v3 if you rely on AWS services that are not supported by Amplify, since aws-sdk-js-v3 is imported modularly.If you can't migrate to aws-sdk-js-v3 or rely on aws-sdk@2.x, you will need to import it separately.
If you are using exported paths within your Amplify JS application, (e.g. import from "@aws-amplify/analytics/lib/Analytics"
) this will now break and no longer will be supported. You will need to change to named imports:
import { Analytics } from 'aws-amplify';
If you are using categories as Amplify.<Category>
, this will no longer work and we recommend to import the category you are needing to use:
import { Auth } from 'aws-amplify';
For more information on contributing to DataStore / how DataStore works, see the DataStore Docs
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4