Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/byteboomers/userhut-js
Userhut JavaScript library
https://github.com/byteboomers/userhut-js
authentication login signin signup userhut
Last synced: 8 days ago
JSON representation
Userhut JavaScript library
- Host: GitHub
- URL: https://github.com/byteboomers/userhut-js
- Owner: byteboomers
- License: mit
- Created: 2019-04-17T11:48:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-15T09:53:42.000Z (almost 2 years ago)
- Last Synced: 2023-08-24T08:14:57.175Z (over 1 year ago)
- Topics: authentication, login, signin, signup, userhut
- Language: JavaScript
- Homepage:
- Size: 369 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# userhut
Userhut JavaScript library
## Installation
### NPM
```bash
npm install --save userhut
```[npm package link](https://www.npmjs.com/package/userhut)
### CDN
```html
```
## Usage
### Initialize
```javascript
import Userhut from "userhut";
const userhut = new Userhut("your-user-pool-id");
await userhut.initialize();
```### Fetch authenticated user
```javascript
const authenticated = await userhut.getAuthenticated();
```### Fetch token
```javascript
const token = await userhut.getToken();
```### Sign out
```javascript
await userhut.signOut();
```### Open sign in page
```javascript
userhut.openSignInPage({
redirect: window.location.href
});
```## Git hooks
- pre-commit: re-format staged files with Prettier
## Scripts
```bash
# Build for production
npm run build# Re-format files with Prettier
npm run prettier
```