Page updated Jan 16, 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 });
1Amplify.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 } } } });
1Amplify.configure({
2 Auth: {
3 Cognito: {
4 userPoolClientId: 'abcdefghij1234567890',
5 userPoolId: 'us-east-1_abcd1234',
6 loginWith: { // Optional
7 oauth: {
8 domain: 'abcdefghij1234567890-29051e27.auth.us-east-1.amazoncognito.com',
9 scopes: ['openid email phone profile aws.cognito.signin.user.admin '],
10 redirectSignIn: ['http://localhost:3000/','https://example.com/'],
11 redirectSignOut: ['http://localhost:3000/','https://example.com/'],
12 responseType: 'code',
13 }
14 username: 'true',
15 email: 'false', // Optional
16 phone: 'false', // Optional
17 }
18 }
19 }
20});

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 } } });
1Amplify.configure({
2 API: {
3 GraphQL: {
4 endpoint:
5 'https://abcdefghij1234567890.appsync-api.us-east-1.amazonaws.com/graphql',
6 defaultAuthMode: 'apiKey',
7 apiKey: 'da-abcdefghij1234567890', // Optional
8 region: 'us-east-1', // Optional
9 customEndpoint: 'https://example.com/graphql', // Optional
10 customEndpointRegion: 'us-east-1' // Optional
11 }
12 }
13});

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 } } } });
1Amplify.configure({
2 API: {
3 REST: {
4 YourAPIName: {
5 endpoint:
6 'https://abcdefghij1234567890.execute-api.us-east-1.amazonaws.com/stageName',
7 region: 'us-east-1' // Optional
8 }
9 }
10 }
11});

Storage (Amazon S3)

Amplify.configure({ Storage: { S3: { bucket: 'your-bucket-name', // Optional region: 'us-east-1' // Optional } } });
1Amplify.configure({
2 Storage: {
3 S3: {
4 bucket: 'your-bucket-name', // Optional
5 region: 'us-east-1' // Optional
6 }
7 }
8});

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 } } });
1Amplify.configure({
2 Analytics: {
3 Personalize: {
4 trackingId: 'abcd1234',
5 region: 'us-east-1',
6 flushInterval: 0, // Optional
7 flushSize: 0 // Optional
8 },
9 Pinpoint: {
10 appId: 'abcdefghij1234567890',
11 region: 'us-east-1',
12 flushInterval: 0, // Optional
13 flushSize: 0, // Optional
14 bufferSize: 0 // Optional
15 },
16 Kinesis: {
17 region: 'us-east-1',
18 flushInterval: 0, // Optional
19 flushSize: 0, // Optional
20 bufferSize: 0 // Optional
21 },
22 KinesisFirehose: {
23 region: 'us-east-1',
24 flushInterval: 0, // Optional
25 flushSize: 0, // Optional
26 bufferSize: 0 // Optional
27 }
28 }
29});

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' } } } } });
1Amplify.configure({
2 Predictions: {
3 convert: {
4 translateText: {
5 region: 'us-east-1',
6 proxy: false,
7 defaults: {
8 sourceLanguage: 'en',
9 targetLanguage: 'zh'
10 }
11 },
12 speechGenerator: {
13 region: 'us-east-1',
14 proxy: false,
15 defaults: {
16 VoiceId: 'Ivy',
17 LanguageCode: 'en-US'
18 }
19 },
20 transcription: {
21 region: 'us-east-1',
22 proxy: false,
23 defaults: {
24 language: 'en-US'
25 }
26 }
27 },
28 identify: {
29 identifyText: {
30 proxy: false,
31 region: 'us-east-1',
32 defaults: {
33 format: 'PLAIN'
34 }
35 },
36 identifyEntities: {
37 proxy: false,
38 region: 'us-east-1',
39 celebrityDetectionEnabled: true,
40 defaults: {
41 collectionId: 'identifyEntities8b89c648',
42 maxEntities: 50
43 }
44 },
45 identifyLabels: {
46 proxy: false,
47 region: 'us-east-1',
48 defaults: {
49 type: 'LABELS'
50 }
51 }
52 },
53 interpret: {
54 interpretText: {
55 region: 'us-east-1',
56 proxy: false,
57 defaults: {
58 type: 'ALL'
59 }
60 }
61 }
62 }
63});

Interactions

Amplify.configure({ Interactions: { LexV1: { MyV1Bot: { alias: 'BotAlias', region: 'us-east-1' } }, LexV2: { MyV2Bot: { botId: 'ABCDE12345', aliasId: 'BotAlias', localeId: 'localId', region: 'us-east-1' } } } });
1Amplify.configure({
2 Interactions: {
3 LexV1: {
4 MyV1Bot: {
5 alias: 'BotAlias',
6 region: 'us-east-1'
7 }
8 },
9 LexV2: {
10 MyV2Bot: {
11 botId: 'ABCDE12345',
12 aliasId: 'BotAlias',
13 localeId: 'localId',
14 region: 'us-east-1'
15 }
16 }
17 }
18});

Notifications

Amplify.configure({ Notifications: { InAppMessaging: { Pinpoint: { appId: 'abcdefgh12345678', region: 'us-east-1' } }, PushNotification: { Pinpoint: { appId: 'abcdefgh12345678', region: 'us-east-1' } } } });
1Amplify.configure({
2 Notifications: {
3 InAppMessaging: {
4 Pinpoint: {
5 appId: 'abcdefgh12345678',
6 region: 'us-east-1'
7 }
8 },
9 PushNotification: {
10 Pinpoint: {
11 appId: 'abcdefgh12345678',
12 region: 'us-east-1'
13 }
14 }
15 }
16});

Geo

Amplify.configure({ Geo: { LocationService: { region: 'us-east-1', maps: { // Optional items: {}, default: '' }, searchIndices: { // Optional items: [''], default: '' }, geofenceCollections: { // Optional items: [''], default: '' } } } });
1Amplify.configure({
2 Geo: {
3 LocationService: {
4 region: 'us-east-1',
5 maps: {
6 // Optional
7 items: {},
8 default: ''
9 },
10 searchIndices: {
11 // Optional
12 items: [''],
13 default: ''
14 },
15 geofenceCollections: {
16 // Optional
17 items: [''],
18 default: ''
19 }
20 }
21 }
22});