Samples for Cognito auth
pchaganti opened this issue · 2 comments
pchaganti commented
Is your feature request related to a specific component? Please add.
Cognito Auth
Describe the solution you'd like
The Cognito auth looks very useful. We are using Cognito extensively and having to implement the React components ourselves. Are there any samples or sample code that shows how to use the Northstar Cognito auth components? Would love to leverage this instead of building our own.
thanks!
jessieweiyi commented
Hi @pchaganti,
Thank you for your interest in NorthStar and NorthStar v2 component.
Please refer to our documentation website for details on how to setup NorthStar v2 and use NorthStar v2 components.
Specifically, for your use case,
- Setup NorthStarThemeProvider if your app is not currently using NorthStar v2 by wrapping your react app with NorthStarThemeProvider component.
- Wrap your authenticated content with CognitoAuth component
- NorthStar v2 also includes some utility helpers for you to use. For example,
- useSigv4Client - A React hook returning an instance of Sigv4Client to be used to run fetch call with AWS signed API requests.
import useSigv4Client from '@aws-northstar/ui/hooks/useSigv4Client'
pchaganti commented
Will try that out.
thanks!