npm.io
1.0.13 • Published 7 years ago

ground-aws-cognito-auth-core

Licence
ISC
Version
1.0.13
Deps
6
Size
16.0 MB
Vulns
0
Weekly
0

 

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.

Documentation