Ground - AWS Cognito Authentication Core
npm install ground-aws-cognito-auth-core
Step 1 - Import Ground Store Provider
import { GroundAuthProvider } from 'ground-aws-cognito-auth-core';
Step 2 - Wrap your application
function App() {
return (
<GroundAuthProvider aws={awsmobile} mode={process.env.NODE_ENV}>
<SignUp />
</GroundAuthProvider>
);
}
Step 3 - Use the context store
import { GroundAuthContextStore } from 'ground-aws-cognito-auth-core'
function SignUp() {
// signup
const signUp = GroundAuthContextStore.useStoreActions(actions => actions.authentication.signUp)
return (
<SignUp onClick={signUp} />
)
}
Introduction
Ground AWS Cognito Authentication Core provides you the Store Provider and manage from you the state for your Ground React application with authenticating user using AWS Cognito.