Open flutterocks opened 1 week ago
Hello @flutterocks thank you for submitting this issue. Flutter can use auth resources without an Amplify backend by modifying amplifyconfiguration.dart in gen 1 or modifying amplify_outputs.json in gen 2.
Please let us know if the linked documentation answers your question!
How do I consume the amplify_outputs.json
or generate amplifyconfiguration
based on it? I am not using Amplify as a backend, just cognito
If you are not using Amplify at all you can still use the defineBackend function with an empty object and then add your own cognito resources following this example: https://docs.amplify.aws/flutter/build-a-backend/auth/use-existing-cognito-resources/#use-auth-resources-with-an-amplify-backend
You can then use amplify to generate the amplifyconfiguration.dart (npx ampx generate outputs --format dart --outputs-version 0
) or amplify_outputs.dart (npx ampx generate outputs --format dart
). Note that Amplify Flutter does not yet support amplify_outputs.dart, but should soon.
If you do not want to go that route you could write the amplifyconfiguration.dart (and later amplify_outputs.dart) manually.
Ensure you are running ampx commands in root of your project (i.e. in the parent of the 'amplify' directory).
Do I need to create a NPM project to run this?
Yes, you would need to create a npm project. I suggest creating an amplify backend app (npm create amplify@latest -y
) but you can then remove the auth/data resources which are added by default.
@flutterocks let me know if you have any other questions
Description
There is amplify documentation for React on Use auth resources without an Amplify backend, but there is nothing for Flutter.
Is this possible with amplify in flutter?
Categories
Steps to Reproduce
n/a
Screenshots
No response
Platforms
Flutter Version
3.19
Amplify Flutter Version
1.7
Deployment Method
Custom Pipeline
Schema
No response