Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated May 8, 2024

Configure Amplify categories

When using the Amplify CLI, the amplifyconfiguration.json file gets created and updated automatically for you based upon the resources you have added and configured.

If you are not using the Amplify CLI or need to override these settings, this documentation shows the available configuration properties for each category.

If you are working with an older project, you can also review the configuration properties for the previous version for your chosen framework or language.

General configuration

The Amplify.configure() configuration can generally be included in your project entrypoint file (i.e. /src/main.js). It takes in two parameters - ResourcesConfig and LibraryOptions.

Amplify.configure({ ...resourcesConfig }, { ...libraryOptions });

Authentication (Amazon Cognito)

Amplify.configure({
Auth: {
Cognito: {
userPoolClientId: 'abcdefghij1234567890',
userPoolId: 'us-east-1_abcd1234',
loginWith: { // Optional
oauth: {
domain: 'abcdefghij1234567890-29051e27.auth.us-east-1.amazoncognito.com',
scopes: ['openid','email','phone','profile','aws.cognito.signin.user.admin'],
redirectSignIn: ['http://localhost:3000/','https://example.com/'],
redirectSignOut: ['http://localhost:3000/','https://example.com/'],
responseType: 'code',
}
username: 'true',
email: 'false', // Optional
phone: 'false', // Optional
}
}
}
});

API GraphQL (AWS AppSync)

Amplify.configure({
API: {
GraphQL: {
endpoint:
'https://abcdefghij1234567890.appsync-api.us-east-1.amazonaws.com/graphql',
defaultAuthMode: 'apiKey',
apiKey: 'da-abcdefghij1234567890', // Optional
region: 'us-east-1', // Optional
customEndpoint: 'https://example.com/graphql', // Optional
customEndpointRegion: 'us-east-1' // Optional
}
}
});

API Rest (Amazon API Gateway)

Amplify.configure({
API: {
REST: {
YourAPIName: {
endpoint:
'https://abcdefghij1234567890.execute-api.us-east-1.amazonaws.com/stageName',
region: 'us-east-1' // Optional
}
}
}
});

Storage (Amazon S3)

Amplify.configure({
Storage: {
S3: {
bucket: 'your-bucket-name', // Optional
region: 'us-east-1' // Optional
}
}
});

Analytics (Amazon Pinpoint)

Amplify.configure({
Analytics: {
Personalize: {
trackingId: 'abcd1234',
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0 // Optional
},
Pinpoint: {
appId: 'abcdefghij1234567890',
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0, // Optional
bufferSize: 0 // Optional
},
Kinesis: {
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0, // Optional
bufferSize: 0 // Optional
},
KinesisFirehose: {
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0, // Optional
bufferSize: 0 // Optional
}
}
});

Predictions

Amplify.configure({
Predictions: {
convert: {
translateText: {
region: 'us-east-1',
proxy: false,
defaults: {
sourceLanguage: 'en',
targetLanguage: 'zh'
}
},
speechGenerator: {
region: 'us-east-1',
proxy: false,
defaults: {
VoiceId: 'Ivy',
LanguageCode: 'en-US'
}
},
transcription: {
region: 'us-east-1',
proxy: false,
defaults: {
language: 'en-US'
}
}
},
identify: {
identifyText: {
proxy: false,
region: 'us-east-1',
defaults: {
format: 'PLAIN'
}
},
identifyEntities: {
proxy: false,
region: 'us-east-1',
celebrityDetectionEnabled: true,
defaults: {
collectionId: 'identifyEntities8b89c648',
maxEntities: 50
}
},
identifyLabels: {
proxy: false,
region: 'us-east-1',
defaults: {
type: 'LABELS'
}
}
},
interpret: {
interpretText: {
region: 'us-east-1',
proxy: false,
defaults: {
type: 'ALL'
}
}
}
}
});

Interactions

Amplify.configure({
Interactions: {
LexV1: {
MyV1Bot: {
alias: 'BotAlias',
region: 'us-east-1'
}
},
LexV2: {
MyV2Bot: {
botId: 'ABCDE12345',
aliasId: 'BotAlias',
localeId: 'localId',
region: 'us-east-1'
}
}
}
});

Notifications

Amplify.configure({
Notifications: {
InAppMessaging: {
Pinpoint: {
appId: 'abcdefgh12345678',
region: 'us-east-1'
}
},
PushNotification: {
Pinpoint: {
appId: 'abcdefgh12345678',
region: 'us-east-1'
}
}
}
});

Geo

Amplify.configure({
Geo: {
LocationService: {
region: 'us-east-1',
maps: {
// Optional
items: {},
default: ''
},
searchIndices: {
// Optional
items: [''],
default: ''
},
geofenceCollections: {
// Optional
items: [''],
default: ''
}
}
}
});