Socket
Book a DemoInstallSign in
Socket

@authtech/tag-manager

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@authtech/tag-manager

test

0.2.7
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

@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:

  • react-native-nfc-manager

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

Keywords

react-native

FAQs

Package last updated on 27 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.