Socket
Socket
Sign inDemoInstall

@justinribeiro/webnfc-reader

Package Overview
Dependencies
4
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @justinribeiro/webnfc-reader

Read nfc tags with WebNFC (currently behind a flag in Chrome for Android).


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

npm version

<webnfc-reader>

A web component that uses WebNFC to read NFC tags.

Features

  • Props down / events up model: set watch options and simply listen for events via addEventListener.
  • sound attribute uses Web Audio API to make a beep when a tag is read (so hip)
  • Built as a web component on Polymer 3 / LitElement

Install

This web component is built with Polymer 3 and ES modules in mind and is available on NPM:

Install webnfc-reader:

npm i @justinribeiro/webnfc-reader
# or
yarn add @justinribeiro/webnfc-reader

After install, import into your project:

import 'webnfc-reader';

Finally, use as required:

<webnfc-reader sound></webnfc-reader>

Chrome Flag Required

Currently, WebNFC is behind a Chrome flag on Android. To enable, go to chrome://flags and enabled WebNFC on an Android compatible device.

Attributes

NameDescriptionDefault
srcNFCWatchOptions.url property denotes the URL pattern which is used for matching the Web NFC Id of Web NFC messages which are being read. The default value "" means that no matching happens.``
recordtypeNFCWatchOptions.recordType property denotes the string value which is used for matching the type property of each NFCRecord object in a Web NFC message. The default value "" means that no matching happens.``
mediatypeNFCWatchOptions.mediaType property denotes the match pattern which is used for matching the type property of each NFCRecord object in a Web NFC message. The default value "" means that no matching happens.``
modeNFCWatchOptions.mode property denotes the NFCWatchMode value telling whether only Web NFC content or any NFC content will be watched.any
verboseStatus messages sent through custom event webnfc-reader-statusfalse
soundMake a beep sound through Web Audio API when tag is readfalse

Events

NameDescription
webnfc-reader-statusWatch and status messages
webnfc-reader-watchReceive WebNFC records on tag read

Keywords

FAQs

Last updated on 10 Jul 2018

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc