Options
All
  • Public
  • Public/Protected
  • All
Menu
AWS Amplify

Discord Chat Language grade: JavaScript build:started

Reporting Bugs / Feature Requests

Open Bugs Feature Requests Closed Issues

Note aws-amplify 5 has been released. If you are looking for upgrade guidance click here

AWS Amplify is a JavaScript library for frontend and mobile developers building cloud-enabled applications

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.

Visit our Documentation site to learn more about AWS Amplify. Please see our Amplify JavaScript page within our Documentation site for information around the full list of features we support.

Features

Category AWS Provider Description
Authentication Amazon Cognito APIs and Building blocks to create Authentication experiences.
Analytics Amazon Pinpoint Collect Analytics data for your application including tracking user sessions.
REST API Amazon API Gateway Sigv4 signing and AWS auth for API Gateway and other REST endpoints.
GraphQL API AWS AppSync Interact with your GraphQL or AWS AppSync endpoint(s).
DataStore AWS AppSync Programming model for shared and distributed data, with simple online/offline synchronization.
Storage Amazon S3 Manages content in public, protected, private storage buckets.
Geo (Developer preview) Amazon Location Service Provides APIs and UI components for maps and location search for JavaScript-based web apps.
Push Notifications Amazon Pinpoint Allows you to integrate push notifications in your app with Amazon Pinpoint targeting and campaign management support.
Interactions Amazon Lex Create conversational bots powered by deep learning technologies.
PubSub AWS IoT Provides connectivity with cloud-based message-oriented middleware.
Internationalization --- A lightweight internationalization solution.
Cache --- Provides a generic LRU cache for JavaScript developers to store data with priority and expiration settings.
Predictions Various* Connect your app with machine learning services like NLP, computer vision, TTS, and more.
  • Predictions utilizes a range of Amazon's Machine Learning services, including: Amazon Comprehend, Amazon Polly, Amazon Rekognition, Amazon Textract, and Amazon Translate.

Getting Started

AWS Amplify is available as aws-amplify on npm.

To get started pick your platform from our Getting Started home page

Notice:

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)]));
  • 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(...);

Amplify 4.x.x has breaking changes for React Native. Please see the breaking changes below:

  • If you are using React Native (vanilla or Expo), you will need to add the following React Native community dependencies:
    • @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.
    • Both options will not be available to use in version 3. You will not be able to use and set your own credentials.
    • For more information on this change, please see the AWS SDK for JavaScript v3
  • 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';

DataStore Docs

For more information on contributing to DataStore / how DataStore works, see the DataStore Docs

Index

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

AWSAppSyncRealTimeAuthInput

AWSAppSyncRealTimeAuthInput: Partial<AWSAppSyncRealTimeProviderOptions> & object

AWSLexProviderSendResponse

AWSLexProviderSendResponse: PostTextCommandOutput | PostContentCommandOutputFormatted

AWSLexV2ProviderSendResponse

AWSLexV2ProviderSendResponse: RecognizeTextCommandOutput | RecognizeUtteranceCommandOutputFormatted

AbortMultipartUploadInput

AbortMultipartUploadInput: Pick<AbortMultipartUploadCommandInput, "Bucket" | "Key" | "UploadId">

ActionMap

ActionMap: object

Type declaration

Alignment

Alignment: object[keyof typeof Alignment]

AllFieldOperators

AllFieldOperators: keyof AllOperators

AllOperators

AllOperators: NumberOperators<any> & StringOperators<any> & ArrayOperators<any>

AmazonLocationServiceBatchGeofenceError

AmazonLocationServiceBatchGeofenceError: Omit<GeofenceError, "error"> & object

AmazonLocationServiceBatchGeofenceErrorMessages

AmazonLocationServiceBatchGeofenceErrorMessages: "AccessDeniedException" | "InternalServerException" | "ResourceNotFoundException" | "ThrottlingException" | "ValidationException"

AmazonLocationServiceDeleteGeofencesResults

AmazonLocationServiceDeleteGeofencesResults: Omit<DeleteGeofencesResults, "errors"> & object

AmazonLocationServiceGeofence

AmazonLocationServiceGeofence: Omit<Geofence, "status"> & object

AmazonLocationServiceGeofenceOptions

AmazonLocationServiceGeofenceOptions: GeofenceOptions & object

AmazonLocationServiceGeofenceStatus

AmazonLocationServiceGeofenceStatus: "ACTIVE" | "PENDING" | "FAILED" | "DELETED" | "DELETING"

AmazonLocationServiceListGeofenceOptions

AmazonLocationServiceListGeofenceOptions: ListGeofenceOptions & object

AmplifyContext

AmplifyContext: object

Type declaration

  • Auth: typeof Auth
  • Cache: typeof Cache
  • InternalAPI: typeof InternalAPI

AmplifyThemeType

AmplifyThemeType: Record<string, any>

ApiInfo

ApiInfo: object

Type declaration

  • Optional custom_header?: function
      • (): object
      • Returns object

        • [key: string]: string
  • endpoint: string
  • Optional region?: string
  • Optional service?: string

ArchiveStatus

ArchiveStatus: object[keyof typeof ArchiveStatus]

ArrayOperators

ArrayOperators: object

Type declaration

  • contains: T
  • notContains: T

AssociatedWith

AssociatedWith: object

Type declaration

  • associatedWith: string | string[]
  • connectionType: "HAS_MANY" | "HAS_ONE"
  • Optional targetName?: string
  • Optional targetNames?: string[]

AttributeType

AttributeType: object[keyof typeof AttributeType]

AuthErrorMessages

AuthErrorMessages: object

Type declaration

AuthModeStrategy

AuthModeStrategy: function

Type declaration

AuthModeStrategyParams

AuthModeStrategyParams: object

Type declaration

AuthModeStrategyReturn

AuthModeStrategyReturn: GRAPHQL_AUTH_MODE | GRAPHQL_AUTH_MODE[] | undefined | null

AuthProviders

AuthProviders: object

Type declaration

  • functionAuthProvider: function

AuthorizationInfo

AuthorizationInfo: object

Type declaration

  • authMode: GRAPHQL_AUTH_MODE
  • isOwner: boolean
  • Optional ownerField?: string
  • Optional ownerValue?: string

AuthorizationRule

AuthorizationRule: object

Type declaration

  • areSubscriptionsPublic: boolean
  • authStrategy: "owner" | "groups" | "private" | "public"
  • groupClaim: string
  • groups: [string]
  • groupsField: string
  • identityClaim: string
  • ownerField: string
  • provider: "userPools" | "oidc" | "iam" | "apiKey"

AutoTrackAttributes

AutoTrackAttributes: function | EventAttributes

BlockList

BlockList: Block[]

BooleanOperators

BooleanOperators: EqualityOperators<T>

BoundingBox

Optional height

height: Number

Optional left

left: Number

Optional top

top: Number

Optional width

width: Number

ButtonAction

ButtonAction: object[keyof typeof ButtonAction]

ChannelType

ChannelType: "ADM" | "APNS" | "APNS_SANDBOX" | "APNS_VOIP" | "APNS_VOIP_SANDBOX" | "BAIDU" | "CUSTOM" | "EMAIL" | "GCM" | "IN_APP" | "PUSH" | "SMS" | "VOICE"

ChecksumAlgorithm

ChecksumAlgorithm: object[keyof typeof ChecksumAlgorithm]

ChecksumMode

ChecksumMode: object[keyof typeof ChecksumMode]

ClientMetaData

ClientMetaData: object | undefined

CommonStorageOptions

CommonStorageOptions: Omit<StorageOptions, "credentials" | "region" | "bucket" | "dangerouslyConnectToHttpEndpointForTesting">

CompatibleHttpResponse

CompatibleHttpResponse: Omit<HttpResponse, "body"> & object

Compatible type for S3 streaming body exposed via Amplify public interfaces, like GetObjectCommandOutput exposed via download API. It's also compatible with the custom transfer handler interface HttpResponse.body.

internal

CompleteMultipartUploadInput

CompleteMultipartUploadInput: Pick<CompleteMultipartUploadCommandInput, "Bucket" | "Key" | "UploadId" | "MultipartUpload" | "SSECustomerAlgorithm" | "SSECustomerKey" | "SSECustomerKeyMD5">

CompositeIdentifier

CompositeIdentifier: IdentifierBrand<object, "CompositeIdentifier">

ConditionProducer

ConditionProducer: function

Type declaration

    • (...args: A): A["length"] extends keyof Lookup<T> ? Lookup<T>[A["length"]] : never
    • Parameters

      • Rest ...args: A

      Returns A["length"] extends keyof Lookup<T> ? Lookup<T>[A["length"]] : never

Config

Config: object

Type declaration

  • [key: string]: string | number

ConfiguredMiddleware

ConfiguredMiddleware: function

Type declaration

ConflictHandler

ConflictHandler: function

Type declaration

ConnectionStatus

ConnectionStatus: object

Type declaration

  • online: boolean

Context

Context: object

Type declaration

  • Optional req?: any

ControlMessageType

ControlMessageType: object

Type declaration

  • Optional data?: any
  • type: T

Coordinates

Coordinates: [Longitude, Latitude]

CopyObjectInput

CopyObjectInput: Pick<CopyObjectCommandInput, "Bucket" | "CopySource" | "Key" | "MetadataDirective" | "CacheControl" | "ContentType" | "ContentDisposition" | "ContentLanguage" | "Expires" | "ACL" | "ServerSideEncryption" | "SSECustomerAlgorithm" | "SSECustomerKey" | "SSECustomerKeyMD5" | "SSEKMSKeyId" | "Tagging" | "Metadata">

CreateMultipartUploadInput

CreateMultipartUploadInput: Extract<CreateMultipartUploadCommandInput, PutObjectInput>

CustomIdentifier

CustomIdentifier: CompositeIdentifier<T, [K]>

CustomPrefix

CustomPrefix: object

Type declaration

CustomUserAgentDetails

CustomUserAgentDetailsBase

CustomUserAgentDetailsBase: object

Type declaration

DailyInAppMessageCounter

DailyInAppMessageCounter: object

Type declaration

  • count: number
  • lastCountTimestamp: string

DataObject

DataObject: object

Type declaration

  • data: Record<string, unknown>

DataPayload

DataPayload: object

Type declaration

DataStoreConfig

DataStoreConfig: object

Type declaration

DataStoreSnapshot

DataStoreSnapshot: object

Type declaration

  • isSynced: boolean
  • items: T[]

DeepWritable

DeepWritable: object

Type declaration

DefaultPersistentModelMetaData

DefaultPersistentModelMetaData: object

Type declaration

DeferredCallbackResolverOptions

DeferredCallbackResolverOptions: object

Type declaration

  • callback: function
      • (): void
      • Returns void

  • Optional errorHandler?: function
      • (error: string): void
      • Parameters

        • error: string

        Returns void

  • Optional maxInterval?: number

DeleteGeofencesResults

DeleteGeofencesResults: object

Type declaration

DeleteObjectInput

DeleteObjectInput: Pick<DeleteObjectCommandInput, "Bucket" | "Key">

DimensionType

DimensionType: object[keyof typeof DimensionType]

EncodingType

EncodingType: object[keyof typeof EncodingType]

EndpointBuffer

EndpointBuffer: Array<EventObject>

EndpointFailureData

EndpointFailureData: object

Type declaration

  • endpointObject: EventObject
  • err: any
  • update_params: any

EndpointResolverOptions

EndpointResolverOptions: object

Basic option type for endpoint resolvers. It contains region only.

Type declaration

  • region: string

EnumFieldType

EnumFieldType: object

Type declaration

  • enum: string

EqualityOperators

EqualityOperators: object

Type declaration

  • eq: T
  • ne: T

ErrorHandler

ErrorHandler: function

Type declaration

ErrorMap

ErrorMap: Partial<object>

ErrorParser

ErrorParser: function

parse errors from given response. If no error code is found, return undefined. This function is protocol-specific (e.g. JSON, XML, etc.)

Type declaration

ErrorType

ErrorType: "ConfigError" | "BadModel" | "BadRecord" | "Unauthorized" | "Transient" | "Unknown"

Event

Event: object

Type declaration

  • attributes: string
  • eventId: string
  • immediate: boolean
  • metrics: string
  • name: string
  • session: object

Optional AppPackageName

AppPackageName: string

The package name of the app that's recording the event.

Optional AppTitle

AppTitle: string

The title of the app that's recording the event.

Optional AppVersionCode

AppVersionCode: string

The version number of the app that's recording the event.

Optional Attributes

Attributes: Record<string, string>

One or more custom attributes that are associated with the event.

Optional ClientSdkVersion

ClientSdkVersion: string

The version of the SDK that's running on the client device.

EventType

EventType: string | undefined

The name of the event.

Optional Metrics

Metrics: Record<string, number>

One or more custom metrics that are associated with the event.

Optional SdkName

SdkName: string

The name of the SDK that's being used to record the event.

Optional Session

Session: Session

Information about the session in which the event occurred.

Timestamp

Timestamp: string | undefined

The date and time, in ISO 8601 format, when the event occurred.

EventBuffer

EventBuffer: Array<EventMap>

EventConfig

EventConfig: object

Type declaration

  • appId: string
  • endpointId: string
  • region: string
  • resendLimit: number

EventMap

EventMap: object

Type declaration

EventObject

EventObject: object

Type declaration

EventParams

EventParams: object

Type declaration

  • config: EventConfig
  • credentials: object
  • event: Event
  • resendLimit: number
  • timestamp: string

EventType

EventsBufferConfig

EventsBufferConfig: object

Type declaration

  • bufferSize: number
  • flushInterval: number
  • flushSize: number
  • resendLimit: number

FeatureType

FeatureType: "TABLES" | "FORMS" | string

FeatureTypes

FeatureTypes: FeatureType[]

FederatedSignInOptions

FederatedSignInOptions: object

Type declaration

FederatedSignInOptionsCustom

FederatedSignInOptionsCustom: object

Type declaration

  • customProvider: string
  • Optional customState?: string

FieldAssociation

FieldAssociation: object

Type declaration

  • connectionType: "HAS_ONE" | "BELONGS_TO" | "HAS_MANY"

FilterType

FilterType: object[keyof typeof FilterType]

Geofence

Geofence: GeofenceBase & object

GeofenceBase

GeofenceBase: object

Type declaration

  • Optional createTime?: Date
  • geofenceId: GeofenceId
  • Optional updateTime?: Date

GeofenceError

GeofenceError: object

Type declaration

  • error: object
    • code: string
    • message: string
  • geofenceId: GeofenceId

GeofenceId

GeofenceId: string

GeofenceInput

GeofenceInput: object

Type declaration

GeofenceOptions

GeofenceOptions: object

Type declaration

  • Optional providerName?: string

GeofencePolygon

GeofencePolygon: LinearRing[]

GetObjectInput

GetObjectInput: Pick<GetObjectCommandInput, "Bucket" | "Key" | "ResponseCacheControl" | "ResponseContentDisposition" | "ResponseContentEncoding" | "ResponseContentLanguage" | "ResponseContentType" | "SSECustomerAlgorithm" | "SSECustomerKey" | "SSECustomerKeyMD5">

GraphQLCondition

GraphQLCondition: Partial<GraphQLField | object>

GraphQLField

GraphQLField: object

Type declaration

  • [field: string]: object
    • [operator: string]: string | number | [number, number]

GraphQLFilter

GraphQLFilter: Partial<GraphQLField | object | object | object>

GraphQLOperation

GraphQLOperation: Source | string

GraphQLSource or string, the type of the parameter for calling graphql.parse

see:

https://graphql.org/graphql-js/language/#parse

GraphQLQuery

GraphQLQuery: T & object

GraphQLSubscription

GraphQLSubscription: T & object

GraphqlAuthModes

GraphqlAuthModes: keyof typeof GRAPHQL_AUTH_MODE

GroupOperator

GroupOperator: "and" | "or" | "not"

HeadObjectInput

HeadObjectInput: Pick<HeadObjectCommandInput, "Bucket" | "Key" | "SSECustomerKey" | "SSECustomerKeyMD5" | "SSECustomerAlgorithm">

Headers

Headers: Record<string, string>

Use basic Record interface to workaround fetch Header class not available in Node.js The header names must be lowercased. TODO: use LowerCase intrinsic when we can support typescript 4.0

HttpTransferHandler

HubCallback

HubCallback: function

Type declaration

HubCapsule

HubCapsule: object

Type declaration

  • channel: string
  • Optional patternInfo?: string[]
  • payload: HubPayload
  • source: string

HubPayload

HubPayload: object

Type declaration

  • Optional data?: any
  • event: string
  • Optional message?: string

Identifier

Identifier: ManagedIdentifier<T, any> | OptionallyManagedIdentifier<T, any> | CompositeIdentifier<T, any> | CustomIdentifier<T, any>

IdentifierBrand

IdentifierBrand: T & object

IdentifierFieldOrIdentifierObject

IdentifierFieldOrIdentifierObject: Pick<T, IdentifierFields<T, M>> | IdentifierFieldValue<T, M>

IdentifierFieldValue

IdentifierFieldValue: MetadataOrDefault<T, M>["identifier"] extends CompositeIdentifier<T, any> ? MetadataOrDefault<T, M>["identifier"]["fields"] extends [any] ? T[MetadataOrDefault<T, M>["identifier"]["fields"][0]] : never : T[MetadataOrDefault<T, M>["identifier"]["field"]]

IdentifierFields

IdentifierFields: string

IdentifierFieldsForInit

IdentifierFieldsForInit: MetadataOrDefault<T, M>["identifier"] extends DefaultPersistentModelMetaData | ManagedIdentifier<T, any> ? never : MetadataOrDefault<T, M>["identifier"] extends OptionallyManagedIdentifier<T, any> ? IdentifierFields<T, M> : MetadataOrDefault<T, M>["identifier"] extends CompositeIdentifier<T, any> ? IdentifierFields<T, M> : never

IdentifySource

ImageBlob

ImageBlob: Buffer | Uint8Array | Blob | string

InAppMessageAction

InAppMessageAction: "CLOSE" | "DEEP_LINK" | "LINK"

InAppMessageConflictHandler

InAppMessageConflictHandler: function

Type declaration

    • (messages: InAppMessage[]): InAppMessage
    • Parameters

      • messages: InAppMessage[]

      Returns InAppMessage

InAppMessageCountMap

InAppMessageCountMap: Record<string, number>

InAppMessageCounts

InAppMessageCounts: object

Type declaration

  • dailyCount: number
  • sessionCount: number
  • totalCount: number

InAppMessageLayout

InAppMessageLayout: "BOTTOM_BANNER" | "CAROUSEL" | "FULL_SCREEN" | "MIDDLE_BANNER" | "MODAL" | "TOP_BANNER"

InAppMessageTextAlign

InAppMessageTextAlign: "center" | "left" | "right"

InAppMessagingEvent

InAppMessagingEvent: object

Type declaration

  • Optional attributes?: Record<string, string>
  • Optional metrics?: Record<string, number>
  • name: string

IndexOptions

IndexOptions: object

Type declaration

  • Optional unique?: boolean

IndexesType

IndexesType: Array<[string, string[], object]>

InferInstructionResultType

InferInstructionResultType: undefined

InferOptionTypeFromTransferHandler

InferOptionTypeFromTransferHandler: Parameters<T>[1]

Type to infer the option type of a transfer handler type.

Instruction

InteractionsMessage

InteractionsResponse

InteractionsResponse: object

Type declaration

  • [key: string]: any

InteractionsTextMessage

InteractionsTextMessage: object

Type declaration

  • content: string
  • options: object
    • messageType: "text"

InteractionsVoiceMessage

InteractionsVoiceMessage: object

Type declaration

  • content: object
  • options: object
    • messageType: "voice"

InternalSchema

InternalSchema: object

Type declaration

InternalSubscriptionMessage

InternalSubscriptionMessage: object

Type declaration

JobEntry

JobEntry: object

Completely internal to BackgroundProcessManager, and describes the structure of an entry in the jobs registry.

Type declaration

  • Optional description?: string

    An object provided by the caller that can be used to identify the description of the job, which can otherwise be unclear from the promise and terminate function. The description can be a string. (May be extended later to also support object refs.)

    Useful for troubleshooting why a manager is waiting for long periods of time on close().

  • promise: Promise<any>

    The underlying promise provided by the job function to wait for.

  • terminate: function

    Request the termination of the job.

      • (): void
      • Returns void

KeyType

KeyType: object

Type declaration

  • Optional compositeKeys?: Set<string>[]
  • Optional primaryKey?: string[]

KeysOfSuperType

KeysOfSuperType: object[keyof T]

KeysOfType

KeysOfType: object[keyof T]

KnownOS

KnownOS: "windows" | "macos" | "unix" | "linux" | "ios" | "android" | "web"

Last

Last: T[Exclude<keyof T, keyof Tail<T>>]

LastParameter

LastParameter: Last<Parameters<F>>

Latitude

Latitude: number

Layout

Layout: object[keyof typeof Layout]

LegacyCallback

LegacyCallback: object

Type declaration

LegacyProvider

LegacyProvider: "google" | "facebook" | "amazon" | "developer" | string

LinearRing

LinearRing: Coordinates[]

LinkedConnectionState

LinkedConnectionState: "connected" | "disconnected"

LinkedConnectionStates

LinkedConnectionStates: object

Type declaration

LinkedHealthState

LinkedHealthState: "healthy" | "unhealthy"

ListGeofenceOptions

ListGeofenceOptions: GeofenceOptions & object

ListGeofenceResults

ListGeofenceResults: object

Type declaration

  • entries: Geofence[]
  • nextToken: string | undefined

ListObjectsCommandOutputContent

ListObjectsCommandOutputContent: _Object

ListObjectsV2Input

ListObjectsV2Input: ListObjectsV2CommandInput

ListPartsInput

ListPartsInput: Pick<ListPartsCommandInput, "Bucket" | "Key" | "UploadId" | "SSECustomerAlgorithm" | "SSECustomerKey" | "SSECustomerKeyMD5">

Longitude

Longitude: number

Lookup

Lookup: object

Type declaration

ManagedIdentifier

ManagedIdentifier: IdentifierBrand<object, "ManagedIdentifier">

MapEntry

MapEntry: [string, RegExp, string]

MapTypeToOperands

MapTypeToOperands: object

Type declaration

MatchableTypes

MatchableTypes: string | string[] | number | number[] | boolean | boolean[]

MergeNoConflictKeys

MergeNoConflictKeys: Options extends [infer OnlyOption] ? OnlyOption : Options extends [infer FirstOption, infer SecondOption] ? FirstOption & SecondOption : Options extends [infer FirstOption, any] ? FirstOption & MergeNoConflictKeys<RestOptions> : never

Type to intersect multiple types if they have no conflict keys.

MetadataDirective

MetadataDirective: object[keyof typeof MetadataDirective]

MetadataOrDefault

MetadataOrDefault: T extends object ? T[typeof __modelMeta__] : DefaultPersistentModelMetaData

MetadataReadOnlyFields

MetadataReadOnlyFields: Extract<MetadataOrDefault<T, M>["readOnlyFields"] | M["readOnlyFields"], keyof T>

MetricsComparator

MetricsComparator: function

Type declaration

    • (metricsVal: number, eventVal: number): boolean
    • Parameters

      • metricsVal: number
      • eventVal: number

      Returns boolean

Middleware

Middleware: function

A slimmed down version of the AWS SDK v3 middleware, only handling tasks after Serde.

Type declaration

MiddlewareContext

MiddlewareContext: object

The context object to store states across the middleware chain.

Type declaration

  • Optional attemptsCount?: number

    The number of times the request has been attempted. This is set by retry middleware

MiddlewareHandler

MiddlewareHandler: function

A slimmed down version of the AWS SDK v3 middleware handler, only handling instantiated requests

Type declaration

    • (request: Input): Promise<Output>
    • Parameters

      • request: Input

      Returns Promise<Output>

ModelAssociation

ModelAttribute

ModelAttribute: object

Type declaration

  • Optional properties?: Record<string, any>
  • type: string

ModelAttributeAuth

ModelAttributeAuth: object

Type declaration

ModelAttributeAuthProperty

ModelAttributeAuthProperty: object

Type declaration

ModelAttributeCompositeKey

ModelAttributeCompositeKey: object

Type declaration

  • properties: object
    • fields: [string, string, string, string, string]
    • name: string
  • type: "key"

ModelAttributeKey

ModelAttributeKey: object

Type declaration

  • properties: object
    • fields: string[]
    • Optional name?: string
  • type: "key"

ModelAttributePrimaryKey

ModelAttributePrimaryKey: object

Type declaration

  • properties: object
    • fields: string[]
    • name: never
  • type: "key"

ModelAttributes

ModelAttributes: ModelAttribute[]

ModelAuthModes

ModelAuthModes: Record<string, object>

ModelAuthRule

ModelAuthRule: object

Type declaration

  • allow: string
  • Optional groupClaim?: string
  • Optional groups?: string[]
  • Optional groupsField?: string
  • Optional identityClaim?: string
  • Optional operations?: string[]
  • Optional ownerField?: string
  • Optional provider?: string

ModelField

ModelField: object

Type declaration

ModelFieldType

ModelFieldType: object

Type declaration

ModelFields

ModelFields: Record<string, ModelField>

ModelInit

ModelInit: object & object

ModelInitBase

ModelInitBase: Omit<T, typeof __modelMeta__ | IdentifierFields<T, M> | MetadataReadOnlyFields<T, M>>

ModelInstanceCreator

ModelInstanceCreator: typeof modelInstanceCreator

Constructs a model and records it with its metadata in a weakset. Allows for the separate storage of core model fields and Amplify/DataStore metadata fields that the customer app does not want exposed.

param

The model constructor.

param

Init data that would normally be passed to the constructor.

returns

The initialized model.

ModelInstanceMetadata

ModelInstanceMetadata: object

Type declaration

  • _deleted: boolean
  • _lastChangedAt: number
  • _version: number

ModelInstanceMetadataWithId

ModelInstanceMetadataWithId: ModelInstanceMetadata & object

ModelKeys

ModelKeys: object

Type declaration

ModelMeta

ModelMeta: object

Type declaration

ModelPredicate

ModelPredicate: object & PredicateGroups<M>

ModelPredicateAggregateExtender

ModelPredicateAggregateExtender: function

Type declaration

ModelPredicateExtender

ModelPredicateExtender: function

A function that accepts a ModelPrecicate, which it must use to return a final condition.

This is used as predicates in DataStore.save(), DataStore.delete(), and DataStore sync expressions.

DataStore.save(record, model => model.field.eq('some value'))

Logical operators are supported. But, condtiions are related records are NOT supported. E.g.,

DataStore.delete(record, model => model.or(m => [
    m.field.eq('whatever'),
    m.field.eq('whatever else')
]))

Type declaration

ModelPredicateNegation

ModelPredicateNegation: function

Type declaration

ModelPredicateOperator

ModelPredicateOperator: function

Type declaration

MutableModel

MutableModel: DeepWritable<Omit<T, IdentifierFields<T, M> | MetadataReadOnlyFields<T, M>>> & Readonly<Pick<T, IdentifierFields<T, M> | MetadataReadOnlyFields<T, M>>>

MutationProcessorEvent

MutationProcessorEvent: object

Type declaration

NELatitude

NELatitude: Latitude

NELongitude

NELongitude: Longitude

NamespaceResolver

NamespaceResolver: function

Type declaration

NetworkStatus

NetworkStatus: object

Type declaration

  • online: boolean

NonModelFieldType

NonModelFieldType: object

Type declaration

  • nonModel: string

NonModelTypeConstructor

NonModelTypeConstructor: object

Type declaration

NonNeverKeys

NonNeverKeys: object[keyof T]

NotificationsCategory

NotificationsCategory: "Notifications"

NotificationsSubCategory

NotificationsSubCategory: "InAppMessaging" | "PushNotification"

NumberOperators

NumberOperators: ScalarNumberOperators<T> & object

OAuthOpts

ObjectCannedACL

ObjectCannedACL: object[keyof typeof ObjectCannedACL]

ObjectLockLegalHoldStatus

ObjectLockLegalHoldStatus: object[keyof typeof ObjectLockLegalHoldStatus]

ObjectLockMode

ObjectLockMode: object[keyof typeof ObjectLockMode]

ObjectStorageClass

ObjectStorageClass: object[keyof typeof ObjectStorageClass]

ObserveQueryOptions

ObserveQueryOptions: Pick<ProducerPaginationInput<T>, "sort">

ObserverQuery

ObserverQuery: object

Type declaration

  • observer: PubSubContentObserver
  • query: string
  • Optional startAckTimeoutId?: ReturnType<typeof setTimeout>
  • Optional subscriptionFailedCallback?: Function
  • Optional subscriptionReadyCallback?: Function
  • subscriptionState: SUBSCRIPTION_STATUS
  • variables: Record<string, unknown>

OmitOptionalFields

OmitOptionalFields: Omit<T, KeysOfSuperType<T, undefined> | OptionalRelativesOf<T>>

OmitOptionalRelatives

OmitOptionalRelatives: Omit<T, OptionalRelativesOf<T>>

OnMessageInteractionEventHandler

OnMessageInteractionEventHandler: function

Type declaration

    • (message: InAppMessage): any
    • Parameters

      • message: InAppMessage

      Returns any

OnPushNotificationMessageHandler

OnPushNotificationMessageHandler: function

Type declaration

OnTokenReceivedHandler

OnTokenReceivedHandler: function

Type declaration

    • (token: string): any
    • Parameters

      • token: string

      Returns any

Option

Option: Option0 | Option1<T>

Option0

Option0: []

Option1

Option1: [V5ModelPredicate<T> | undefined]

OptionToMiddleware

OptionToMiddleware: Options extends [] ? [] : Options extends [infer LastOption] ? [Middleware<Request, Response, LastOption>] : Options extends [infer FirstOption, any] ? [Middleware<Request, Response, FirstOption>, any] : never

Type to convert a middleware option type to a middleware type with the given option type.

OptionalRelativesOf

OptionalRelativesOf: KeysOfType<T, AsyncCollection<any>> | KeysOfSuperType<T, Promise<undefined>>

OptionalizeKey

OptionalizeKey: Omit<T, K & keyof T> & object

OptionallyManagedIdentifier

OptionallyManagedIdentifier: IdentifierBrand<object, "OptionallyManagedIdentifier">

PaginationInput

PaginationInput: object

Type declaration

  • Optional limit?: number
  • Optional page?: number
  • Optional sort?: SortPredicate<T>

ParameterizedStatement

ParameterizedStatement: [string, any[]]

ParsedMessagePayload

ParsedMessagePayload: object

Type declaration

  • payload: object
    • connectionTimeoutMs: number
    • Optional errors?: [object]
  • type: string

PersistentModel

PersistentModel: Readonly<Record<string, any>>

PersistentModelConstructor

PersistentModelConstructor: object

Type declaration

PersistentModelMetaData

PersistentModelMetaData: object

Type declaration

  • Optional identifier?: Identifier<T>
  • Optional readOnlyFields?: string

PickOptionalFields

PickOptionalFields: Pick<T, KeysOfSuperType<T, undefined> | OptionalRelativesOf<T>>

PickOptionalRelatives

PickOptionalRelatives: Pick<T, OptionalRelativesOf<T>>

PickProviderOutput

PickProviderOutput: T extends StorageProvider ? T["getProviderName"] extends "AWSS3" ? DefaultOutput : T extends StorageProviderWithCopy & StorageProviderWithGetProperties ? ReturnType<T[api]> : T extends StorageProviderWithCopy ? ReturnType<T[Exclude<api, "getProperties">]> : T extends StorageProviderWithGetProperties ? ReturnType<T[Exclude<api, "copy">]> : ReturnType<T[Exclude<api, "copy" | "getProperties">]> : T extends object ? T extends object ? DefaultOutput : Promise<any> : DefaultOutput

Utility type for checking if the generic type is a provider or a Record that has the key 'provider'. If it's a provider, check if it's the S3 Provider, use the default type else use the generic's 'get' method return type. If it's a Record, check if provider is 'AWSS3', use the default type else use any.

PlaceGeometry

PlaceGeometry: object

Type declaration

PlatformDetectionEntry

PlatformDetectionEntry: object

Type declaration

  • detectionMethod: function
      • (): boolean
      • Returns boolean

  • platform: Framework

Polygon

Polygon: Array<Point> | Iterable<Point>

PolygonGeometry

PolygonGeometry: object

Type declaration

PredicateExpression

PredicateExpression: TypeName<FT> extends keyof MapTypeToOperands<FT> ? function : never

PredicateFieldType

PredicateFieldType: NonNullable<Scalar<T extends Promise<infer InnerPromiseType> ? InnerPromiseType : T extends AsyncCollection<infer InnerCollectionType> ? InnerCollectionType : T>>

PredicateGroups

PredicateGroups: object

Type declaration

PredicateObject

PredicateObject: object

Type declaration

  • field: keyof T
  • operand: any
  • operator: keyof AllOperators

PredicatesGroup

PredicatesGroup: object

Type declaration

ProducerModelPredicate

ProducerModelPredicate: function

Type declaration

ProducerPaginationInput

ProducerPaginationInput: object

Type declaration

ProducerSortPredicate

ProducerSortPredicate: function

Type declaration

Properties

Properties: object

Type declaration

  • [key: string]: any

PropertyNameWithStringValue

PropertyNameWithStringValue: string

PropertyNameWithSubsequentDeserializer

PropertyNameWithSubsequentDeserializer: [string, function]

PubSubContent

PubSubContent: Record<string, unknown> | string

PubSubContentObserver

PubSubContentObserver: SubscriptionObserver<PubSubContent>

PubSubObservable

PubSubObservable: object

Type declaration

PutEventsResponse

PutEventsResponse: object

Type declaration

  • EventsResponse: object
    • Optional Results?: object
      • [endpointId: string]: object
        • Optional EventsItemResponse?: object
          • [eventId: string]: object
            • Optional Message?: string
            • Optional StatusCode?: number

EventsResponse

EventsResponse: EventsResponse | undefined

Provides information about endpoints and the events that they're associated with.

PutObjectCommandInputType

PutObjectCommandInputType: Omit<PutObjectRequest, "Body"> & object

PutObjectInput

PutObjectInput: Pick<PutObjectCommandInput, "Bucket" | "Key" | "Body" | "ServerSideEncryption" | "SSECustomerAlgorithm" | "SSECustomerKey" | "SSECustomerKeyMD5" | "SSEKMSKeyId" | "ACL" | "CacheControl" | "ContentDisposition" | "ContentEncoding" | "ContentType" | "ContentMD5" | "Expires" | "Metadata" | "Tagging">

Reference: S3ProviderPutConfig

PutResult

PutResult: object

Type declaration

  • key: string

RecursiveModelPredicate

RecursiveModelPredicate: object & object & PredicateInternalsKey

RecursiveModelPredicateAggregateExtender

RecursiveModelPredicateAggregateExtender: function

Type declaration

RecursiveModelPredicateExtender

RecursiveModelPredicateExtender: function

A function that accepts a RecursiveModelPrecicate, which it must use to return a final condition.

This is used in DataStore.query(), DataStore.observe(), and DataStore.observeQuery() as the second argument. E.g.,

DataStore.query(MyModel, model => model.field.eq('some value'))

More complex queries should also be supported. E.g.,

DataStore.query(MyModel, model => model.and(m => [
  m.relatedEntity.or(relative => [
    relative.relativeField.eq('whatever'),
    relative.relativeField.eq('whatever else')
  ]),
  m.myModelField.ne('something')
]))

Type declaration

RecursiveModelPredicateNegation

RecursiveModelPredicateNegation: function

Type declaration

RecursiveModelPredicateOperator

RecursiveModelPredicateOperator: function

RelationType

RelationType: object

Type declaration

  • Optional associatedWith?: string | string[]
  • fieldName: string
  • modelName: string
  • relationType: "HAS_ONE" | "HAS_MANY" | "BELONGS_TO"
  • Optional targetName?: string
  • Optional targetNames?: string[]

RelationshipType

RelationshipType: object

Type declaration

ReplicationStatus

ReplicationStatus: object[keyof typeof ReplicationStatus]

RequestCharged

RequestCharged: object[keyof typeof RequestCharged]

RequestPayer

RequestPayer: object[keyof typeof RequestPayer]

ResponseBodyMixin

ResponseBodyMixin: Pick<Body, "blob" | "json" | "text">

Reduce the API surface of Fetch API's Body mixin to only the methods we need. In React Native, body.arrayBuffer() is not supported. body.formData() is not supported for now.

ResumableUploadConfig

ResumableUploadConfig: object

Type declaration

S3Bucket

S3Bucket: string

S3ClientOptions

S3ClientOptions: StorageOptions & object & S3ProviderListConfig

S3CopyDestination

S3CopyDestination: Omit<S3CopyTarget, "identityId">

S3CopySource

S3CopySource: S3CopyTarget

S3EndpointResolverOptions

S3EndpointResolverOptions: EndpointResolverOptions & object

Options for endpoint resolver.

internal

S3ObjectName

S3ObjectName: string

S3ObjectVersion

S3ObjectVersion: string

S3ProviderCopyConfig

S3ProviderCopyConfig: Omit<CommonStorageOptions, "level"> & object

Configuration options for the S3 copy function.

remarks

The acl parameter may now only be used for S3 buckets with specific Object Owner settings. Usage of this parameter is not considered a recommended practice: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html

S3ProviderCopyOutput

S3ProviderCopyOutput: object

Type declaration

  • key: string

S3ProviderGetConfig

S3ProviderGetConfig: CommonStorageOptions & object

S3ProviderGetOuput

S3ProviderGetOuput: T extends object ? GetObjectOutput : string

S3ProviderGetPropertiesConfig

S3ProviderGetPropertiesConfig: CommonStorageOptions & object

S3ProviderGetPropertiesOutput

S3ProviderGetPropertiesOutput: object

Type declaration

  • contentLength: number
  • contentType: string
  • eTag: string
  • lastModified: Date
  • metadata: Record<string, string>

S3ProviderListConfig

S3ProviderListConfig: CommonStorageOptions & object

S3ProviderListOutput

S3ProviderListOutput: object

Type declaration

S3ProviderPutConfig

S3ProviderPutConfig: CommonStorageOptions & object | object & object

Configuration options for the S3 put function.

remarks

The acl parameter may now only be used for S3 buckets with specific Object Owner settings. Usage of this parameter is not considered a recommended practice: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html

S3ProviderPutOutput

S3ProviderPutOutput: T extends object ? UploadTask : Promise<PutResult>

S3ProviderRemoveConfig

S3ProviderRemoveConfig: CommonStorageOptions & object

S3ProviderRemoveOutput

S3ProviderRemoveOutput: DeleteObjectOutput

SWLatitude

SWLatitude: Latitude

SWLongitude

SWLongitude: Longitude

SaveGeofencesResults

SaveGeofencesResults: object

Type declaration

Scalar

Scalar: T extends Array<infer InnerType> ? InnerType : T

ScalarNumberOperators

ScalarNumberOperators: EqualityOperators<T> & object

Schema

Schema: UserSchema & object

SchemaEnum

SchemaEnum: object

Type declaration

  • name: string
  • values: string[]

SchemaEnums

SchemaEnums: Record<string, SchemaEnum>

SchemaModel

SchemaModel: object

Type declaration

  • Optional allFields?: ModelFields

    Explicitly defined fields plus implied fields. (E.g., foreign keys.)

  • Optional attributes?: ModelAttributes
  • fields: ModelFields

    Explicitly defined fields.

  • name: string
  • pluralName: string
  • Optional syncable?: boolean

SchemaModels

SchemaModels: Record<string, SchemaModel>

SchemaNamespace

SchemaNamespace: UserSchema & object

SchemaNamespaces

SchemaNamespaces: Record<string, SchemaNamespace>

SchemaNonModel

SchemaNonModel: object

Type declaration

SchemaNonModels

SchemaNonModels: Record<string, SchemaNonModel>

SearchByCoordinatesOptions

SearchByCoordinatesOptions: object

Type declaration

  • Optional maxResults?: number
  • Optional providerName?: string
  • Optional searchIndexName?: string

SearchByTextOptions

SearchForSuggestionsResult

SearchForSuggestionsResult: object

Type declaration

  • Optional placeId?: string
  • text: string

SearchForSuggestionsResults

SearchForSuggestionsResults: SearchForSuggestionsResult[]

ServerSideEncryption

ServerSideEncryption: object[keyof typeof ServerSideEncryption]

SessionState

SessionState: "started" | "ended"

SessionStateChangeHandler

SessionStateChangeHandler: function

Type declaration

SettableFieldType

SettableFieldType: T extends Promise<infer InnerPromiseType> ? undefined extends InnerPromiseType ? InnerPromiseType | null : InnerPromiseType : T extends AsyncCollection<infer InnerCollectionType> ? InnerCollectionType[] | undefined : undefined extends T ? T | null : T

SettingMetaData

SettingMetaData: object

Type declaration

SignInOpts

SortPredicate

SortPredicate: object

Type declaration

SortPredicateExpression

SortPredicateExpression: TypeName<FT> extends keyof MapTypeToOperands<FT> ? function : never

SortPredicateObject

SortPredicateObject: object

Type declaration

  • field: keyof T
  • sortDirection: keyof typeof SortDirection

SortPredicatesGroup

SortPredicatesGroup: SortPredicateObject<T>[]

SourceData

SourceData: string | ArrayBuffer | ArrayBufferView

StartParams

StartParams: object

Type declaration

  • fullSyncInterval: number

StorageAccessLevel

StorageAccessLevel: "public" | "protected" | "private"

StorageCopyConfig

StorageCopyConfig: T extends StorageProviderWithCopy ? StorageOperationConfig<T, "copy"> : StorageOperationConfigMap<StorageOperationConfig<AWSS3Provider, "copy">, T>

StorageCopyDestination

StorageCopyDestination: Omit<StorageCopyTarget, "identityId">

StorageCopyOutput

StorageCopyOutput: PickProviderOutput<Promise<S3ProviderCopyOutput>, T, "copy">

StorageCopySource

StorageCopySource: StorageCopyTarget

StorageCopyTarget

StorageCopyTarget: object

Type declaration

  • Optional identityId?: string
  • key: string
  • Optional level?: string

StorageFacade

StorageFacade: Omit<Adapter, "setUp">

StorageGetConfig

StorageGetConfig: T extends StorageProvider ? StorageOperationConfig<T, "get"> : StorageOperationConfigMap<StorageOperationConfig<AWSS3Provider, "get">, T>

StorageGetOutput

StorageGetOutput: PickProviderOutput<Promise<S3ProviderGetOuput<T>>, T, "get">

StorageGetPropertiesConfig

StorageGetPropertiesConfig: T extends StorageProviderWithGetProperties ? StorageOperationConfig<T, "getProperties"> : StorageOperationConfigMap<StorageOperationConfig<AWSS3Provider, "getProperties">, T>

StorageGetPropertiesOutput

StorageGetPropertiesOutput: PickProviderOutput<Promise<S3ProviderGetPropertiesOutput>, T, "getProperties">

StorageListConfig

StorageListConfig: T extends StorageProvider ? StorageOperationConfig<T, "list"> : StorageOperationConfigMap<StorageOperationConfig<AWSS3Provider, "list">, T>

StorageListOutput

StorageListOutput: PickProviderOutput<Promise<S3ProviderListOutput>, T, "list">

StorageOperationConfig

StorageOperationConfig: ReturnType<T["getProviderName"]> extends "AWSS3" ? LastParameter<AWSS3Provider[U]> : T extends StorageProviderWithGetProperties & StorageProviderWithCopy ? LastParameter<T[U]> & object : T extends StorageProviderWithCopy ? LastParameter<T[Exclude<U, "getProperties">]> & object : T extends StorageProviderWithGetProperties ? LastParameter<T[Exclude<U, "copy">]> & object : LastParameter<T[Exclude<U, "copy" | "getProperties">]> & object

If provider is AWSS3, provider doesn't have to be specified since it's the default, else it has to be passed into config.

StorageOperationConfigMap

StorageOperationConfigMap: T extends object ? T extends object ? Default : T & object : Default

Utility type to allow custom provider to use any config keys, if provider is set to AWSS3 then it should use AWSS3Provider's config.

StorageProviderApi

StorageProviderApi: "copy" | "get" | "put" | "remove" | "list" | "getProperties"

StoragePutConfig

StoragePutConfig: T extends StorageProvider ? StorageOperationConfig<T, "put"> : StorageOperationConfigMap<StorageOperationConfig<AWSS3Provider, "put">, T>

StoragePutOutput

StoragePutOutput: PickProviderOutput<S3ProviderPutOutput<T>, T, "put">

StorageRemoveConfig

StorageRemoveConfig: T extends StorageProvider ? StorageOperationConfig<T, "remove"> : StorageOperationConfigMap<StorageOperationConfig<AWSS3Provider, "remove">, T>

StorageRemoveOutput

StorageRemoveOutput: PickProviderOutput<Promise<S3ProviderRemoveOutput>, T, "remove">

StorageSubscriptionMessage

StorageSubscriptionMessage: InternalSubscriptionMessage<T> & object