I want to use Amazon Cognito for website user login and authentication functionality.
Installed aws-sdk as npm_module under backend.
Within my masterpage trying to import the module but I am getting error as “Cannot find module ‘Backend/aws-sdk’”
I tried
import AWS from ‘Backend/aws-sdk’; / import AWS from ‘aws-sdk’; / import AWS from ‘Backendnode/modules/aws-sdk’;
but everything failes.
You should name it import AWS from ‘backend/aws-sdk’;
Thanks Andreas !!!
But my issue was something else and now its fixed.
It got solved by moving my AWS code into a backend file. Initially it was present in one of mt frontend file.
That’s what happens when you are a non - technical first time coder and don’t know the basics … my bad :).
Hey, yes if you are using fetch or something like that backend modules are preferred because otherwise cross domain issues might occur.
hello @herefordeal , may you share the integration method and how you are using it? I have an app thats not on wix that uses AWS cognito for auth, I want to have them able to use the wix member pages without having to signup twice, or vice versa, if a wix visitor signs up, to automatically become a user in cognito pool, I’d really appreciate your help
aws-config.js is used by browser sessions to configure the SDK.aws-exports.js is used by SPA applications that are packed (by Webpack, Browserify, or similar tools) to configure the SDK.
You need the aws-exports.js file for the React app. You can download this file from the Amazon S3 bucket using either the AWS Mobile Hub console or the AWS CLI. To download via the CLI, use the following:
aws s3 cp s3://bucket/aws-exports.js ./src/aws-exports.js