0.2.7 • Published 2 years ago

@authtech/tag-manager v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.2.6

2 years ago

0.2.3

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago