# react-native-login-amz

> TODO

Latest version **1.1.11** (published 2020-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-login-amz
pnpm add react-native-login-amz
yarn add react-native-login-amz
bun add react-native-login-amz
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.11 |
| Published | 2020-03-31 |
| First published | 2020-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 44.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Your Name |
| Maintainers | nvdnvd00 |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-login-amz
- Repository: https://github.com/nvdnvd00/react-native-login-amazon
- Homepage: https://github.com/nvdnvd00/react-native-login-amazon#readme
- Issues: https://github.com/nvdnvd00/react-native-login-amazon/issues
- npm.io page: https://npm.io/package/react-native-login-amz

## Recent versions

- 1.1.11 (latest) — 2020-03-31
- 1.0.0 — 2020-03-30

## README

# react-native-login-amz

## Installation

`$ npm install react-native-login-amz --save`

or

`$ yarn add react-native-login-amz`

(RN <0.59)`$ react-native link react-native-login-amz`

- Check [this link](https://developer.amazon.com/docs/login-with-amazon/minitoc-lwa-ios.html) for IOS and [this link](https://developer.amazon.com/docs/login-with-amazon/minitoc-lwa-android.html) for Android.
- Make sure you have done step 3

### Add your api key

#### IOS

- Add your api key to `Info.plist` ([Instruction](https://developer.amazon.com/docs/login-with-amazon/create-ios-project.html#add-api-key)).

#### Android

- Create `api_key.txt` in `android/app/src/main/assets` and put you Amazon api key here ([Instruction ](https://developer.amazon.com/docs/login-with-amazon/create-android-project.html#add-api-key)).

## Usage

```javascript
import { useEffect } from "react";
import { Text, TouchableOpacity } from "react-native";
import LoginAmz from "react-native-login-amz";
const LoginAmzEventEmitter = new NativeEventEmitter(LoginAmz);

const Screen = () => {
  useEffect(() => {
    const handler = LoginAmzEventEmitter.addListener("LOGINAMZ", data => {
      console.log("AMZ LOGIN", data);
      if (data.status === "Ok") {
        //
      }
      if (data.status === "Error") {
        //
      }
      if (data.status === "Cancel") {
        //
      }
    });
    return () => {
      handler.remove();
    };
  }, []);
  return (
    <TouchableOpacity onPress={() => LoginAmz.loginAMZ()}>
      <Text>Login</Text>
    </TouchableOpacity>
  );
};
```

---
_Source: https://npm.io/package/react-native-login-amz · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
