# @authtech/tag-manager

> test

Latest version **0.2.7** (published 2023-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @authtech/tag-manager
pnpm add @authtech/tag-manager
yarn add @authtech/tag-manager
bun add @authtech/tag-manager
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.7 |
| Published | 2023-08-27 |
| First published | 2023-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 16.0.0 |
| Dependencies | 3 |
| Unpacked size | 88.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ccgomezn |
| Maintainers | ccgomezn, changhwan |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/@authtech/tag-manager
- Repository: https://github.com/authtech-co/tag-manager
- Homepage: https://github.com/authtech-co/tag-manager#readme
- Issues: https://github.com/authtech-co/tag-manager/issues
- npm.io page: https://npm.io/package/@authtech/tag-manager

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^1.4.0
- [js-base64](https://npm.io/package/js-base64.md) ^3.7.5
- [react-native-nfc-manager](https://npm.io/package/react-native-nfc-manager.md) ^3.14.7

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.2.7 (latest) — 2023-08-27
- 0.2.6 — 2023-07-07
- 0.2.5 — 2023-07-07
- 0.2.3 — 2023-07-05
- 0.2.4 — 2023-07-05
- 0.2.2 — 2023-06-28
- 0.2.1 — 2023-06-14
- 0.2.0 — 2023-06-14
- 0.1.4 — 2023-06-04
- 0.1.3 — 2023-06-02
- 0.1.2 — 2023-06-01
- 0.1.1 — 2023-05-30
- 0.1.0 — 2023-05-30

## README

# @authtech/tag-manager

NFC card reader for Authtech implementations

## Installation

Install the package in your project directory with:

```sh
npm install @authtech/tag-manager
```

### Installing dependencies

To use this package, you need to install the following dependencies:

- [react-native-nfc-manager](https://github.com/revtel/react-native-nfc-manager)

In your project directory, run:

```sh
npm install react-native-nfc-manager
```

## Usage

### Read NFC data

```typescript
import { startSession, clearSession, readTag, decryptTagData } from '@authtech/tag-manager';

// ...

const AUTHTECH_API_KEY = 'pk_test_TYooMQauvdEDq54NiTphI7jx'

try {
  await startSession()
  const tagData = await readTag()
} finally {
  await clearSession()
}
```

### Decrypt TAG data

```typescript
const decryptedData = await decryptTagData(tagData, AUTHTECH_API_KEY)
```

### React Hook

```typescript jsx
import { useTagManager } from '@authtech/tag-manager';

// ...

const { data, state, read, clear } = useTagManager({ apiKey: AUTHTECH_API_KEY })

return (
  <View>
    <Text>{state}</Text>
    <Button onPress={read}>Read</Button>
  </View>
)
```

## API

### `readTag()`

Reads the NFC tag and returns the data as a string.

### `requestDecrypt(tagData, apiKey)`

Decrypts the tag data and returns the decrypted data as a object.

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---
_Source: https://npm.io/package/@authtech/tag-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
