0.2.7 • Published 9 months ago

@authtech/tag-manager v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@authtech/tag-manager

NFC card reader for Authtech implementations

Installation

Install the package in your project directory with:

npm install @authtech/tag-manager

Installing dependencies

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

In your project directory, run:

npm install react-native-nfc-manager

Usage

Read NFC data

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

const decryptedData = await decryptTagData(tagData, AUTHTECH_API_KEY)

React Hook

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 to learn how to contribute to the repository and the development workflow.

License

MIT

0.2.7

9 months ago

0.2.6

10 months ago

0.2.3

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.4

11 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago