userhut
v1.0.8
Published
Userhut JavaScript library
Downloads
3
Maintainers
Readme
userhut
Userhut JavaScript library
Installation
NPM
npm install --save userhut
CDN
<script src="https://unpkg.com/userhut@latest"></script>
Usage
Initialize
import Userhut from "userhut";
const userhut = new Userhut("your-user-pool-id");
await userhut.initialize();
Fetch authenticated user
const authenticated = await userhut.getAuthenticated();
Fetch token
const token = await userhut.getToken();
Sign out
await userhut.signOut();
Open sign in page
userhut.openSignInPage({
redirect: window.location.href
});
Git hooks
- pre-commit: re-format staged files with Prettier
Scripts
# Build for production
npm run build
# Re-format files with Prettier
npm run prettier