# @ivyhjk/amplify-react-core-auth

> Core React authentication wrapper for amplify

Latest version **1.0.0-next.1** (published 2021-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ivyhjk/amplify-react-core-auth
pnpm add @ivyhjk/amplify-react-core-auth
yarn add @ivyhjk/amplify-react-core-auth
bun add @ivyhjk/amplify-react-core-auth
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-next.1 |
| Published | 2021-01-03 |
| First published | 2021-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Elvis Munoz |
| Maintainers | ivyhjk |

## Links

- npm: https://www.npmjs.com/package/@ivyhjk/amplify-react-core-auth
- Repository: https://github.com/ivyhjk/amplify-react-auth
- Homepage: https://github.com/ivyhjk/amplify-react-auth/tree/master/packages/core-auth#readme
- Issues: https://github.com/ivyhjk/amplify-react-auth/issues
- npm.io page: https://npm.io/package/@ivyhjk/amplify-react-core-auth

## Recent versions

- 1.0.0-next.1 (latest) — 2021-01-03
- 1.0.0-next.10 (next) — 2021-09-04
- 1.0.0-next.8 — 2021-04-02
- 1.0.0-next.7 — 2021-04-02
- 1.0.0-next.6 — 2021-04-02
- 1.0.0-next.5 — 2021-04-02
- 1.0.0-next.3 — 2021-01-07

## README

# React Amplify core authentication provider

React core authentication provider based on top of AWS Amplify

## Install

with NPM:

```bash
npm install @ivyhjk/amplify-react-core-auth
```

with yarn:

```bash
yarn add @ivyhjk/amplify-react-core-auth
```

## Usage

Put the context in your main application component:

```tsx
import { CoreAuthContext } from '@ivyhjk/amplify-react-core-auth';

const App: React.Fc = () => (
  <CoreAuthContext>
    {/* ... */}
  </CoreAuthContext>
);
```

### Hooks

Get the current authenticated user, directly from amplify, without cache:

```tsx
import { useCurrentAuthenticatedUser } from '@ivyhjk/amplify-react-core-auth';

const UserComponent: React.FC = () => {
  const { error, loading, user } = useCurrentAuthenticatedUser();

  return (
    <p>
      Welcome {user.name}
    </p>
  );
}
```

Get the current authenticated user, from context (fastest):

```tsx
import { useUser } from '@ivyhjk/amplify-react-core-auth';

const UserComponent: React.FC = () => {
  const user = useUser();

  return (
    <p>
      Welcome {user.name}
    </p>
  );
}
```

---
_Source: https://npm.io/package/@ivyhjk/amplify-react-core-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
