I am building an app with Flutter and my backend uses different services from AWS. I don't want to use the Amplify CLI because I don't need to create backends. I manage my backends with proprietary CDK logic that gives me more flexibility than Amplify.
I was wondering if anyone knows of complete documentation on how the amplifyconfiguration.dart file is supposed to be managed for each asset (Cognito, S3, and so on). Reading through the Amplify Docs I found this website with information about Cognito. Spoiler alert, the documentation is incomplete and if you use the config as specified you will get errors. For the config to work (if you are not using OAuth), you would need to have something like this:
const amplifyconfig = ''' {
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"IdentityManager": {
"Default": {}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "[COGNITO IDENTITY POOL ID]",
"Region": "[REGION]"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "[COGNITO USER POOL ID]",
"AppClientId": "[COGNITO USER POOL APP CLIENT ID]",
"Region": "[REGION]"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_SRP_AUTH",
"socialProviders": [],
"usernameAttributes": ["EMAIL"],
"signupAttributes": ["BIRTHDATE"],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
}
}
}
}
}
}
}''';
When you try to implement Amplify without the CLI on a React application there is modestly good documentation on how the config file should be managed; you can find it here. I was wondering if anyone knows of something similar for Flutter. I feel the Amplify documentation is lacking when going for a more "vanilla" integration that doesn't utilize the CLI.
It would be great if someone from the Amplify team could shed some light on this.
1 Answer 1
Agree, it's difficult to get what needs to be put in the config if we don't use CLI.
Here are few links, which may help you to construct valid configuration in dart file.
- Schema reference
- amplify-backend/packages/client-config/src/client-config-schema. Here, you should refer
schema_v1.1.jsonorschema_v1.jsonfile. - Discussion on GitHub issue - Contradictory Information - amplifyconfiguration.json
For Auth and Data category, this configuration is available on Amplify website.
3 Comments
Explore related questions
See similar questions with these tags.