I've published my React application to amplify, everything went fine there. But when I open the amplify URL I see that no items have been fetched from database and I have an error in console saying "No credentials"
I think the problem lies with the AppSync API somehow. I made it using the Amplify CLI, it uses API key authentication.
Locally I provide credentials using the generated file aws-exports.js
. I Import this in my index.tsx
like so:
import awsmobile from "./aws-exports";
Amplify.configure(awsmobile);
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
But this file is not pushed to git, so Amplify obviously doesn't have this from the repo. But I assumed that it was able to generate its own aws-exports.js
file, as it doesn't give any errors on the import.
So, what am I missing here? Do I have to use another method for authentication on my AppSync api or what is wrong here? Thanks!