Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkershner6/react-hooks-firebase-auth
Library for easy handling of Firebase Authentication, complete with provider token related events
https://github.com/dkershner6/react-hooks-firebase-auth
npm-package react react-hooks
Last synced: about 2 months ago
JSON representation
Library for easy handling of Firebase Authentication, complete with provider token related events
- Host: GitHub
- URL: https://github.com/dkershner6/react-hooks-firebase-auth
- Owner: dkershner6
- License: mit
- Archived: true
- Created: 2020-06-22T18:53:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-31T03:30:36.000Z (11 months ago)
- Last Synced: 2024-09-26T00:36:56.378Z (about 2 months ago)
- Topics: npm-package, react, react-hooks
- Language: TypeScript
- Homepage:
- Size: 858 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-hooks-firebase-auth
Archived: I don't use Firebase anymore, but will leave this here in case it has value.
Library for easy handling of Firebase Authentication, complete with provider token related events
![Release and Publish](https://github.com/dkershner6/react-hooks-firebase-auth/workflows/Release%20and%20Publish/badge.svg)
## Sample Provider Use
```typescript
const CompleteFirebaseAuthProvider = ({ children }): ReactElement => {
return (
}
loadingComponent={
}
errorComponent={Error
}
onNewLoginSuccess={onNewLoginSuccess}
onLogout={onLogout}
onOldLoginRetrieval={onOldLoginRetrieval}
>
{children}
);
};
```And then for your main app file...
```typescript
```
## Sample Container use
```typescript
import { useContainer } from 'unstated-next';
import { FirebaseAuthContainer } from 'react-hooks-firebase-auth';const Component = () => {
const { user, token } = useContainer(FirebaseAuthContainer);
};
```## Sample Auth Enforcement
```typescript
import { EnforceFirebaseAuth } from 'react-hooks-firebase-auth';const Component = () => {
return (
);
};
```OR
```typescript
import { withFirebaseAuth } from 'react-hooks-firebase-auth';const Component = () => {
return ;
};export default withFirebaseAuth(Component);
```