---
description: The Capacitor NFC plugin enables interaction with NFC tags and provides cross-platform support for Android, iOS, and Web.
title: Announcing the NFC Plugin for Capacitor - Capawesome
image: https://capawesome.io/docs/assets/images/social/blog/announcing-the-capacitor-nfc-plugin.png
---

[ Skip to content](#announcing-the-capacitor-nfc-plugin) 

[ 🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode.](/blog/announcing-the-capacitor-vault-plugin/) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  Grafana Faro ](/docs/plugins/grafana-faro/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  Navigation Bar ](/docs/plugins/navigation-bar/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Vault ](/docs/plugins/vault/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  Closing Thoughts ](#closing-thoughts)

* Related links

# Announcing the Capacitor NFC Plugin[¶](#announcing-the-capacitor-nfc-plugin "Permanent link")

Today we are happy to introduce the brand new [Capacitor NFC](/docs/plugins/nfc/) plugin from Capawesome, sponsored by [NFC21](https://nfc21.de/?%5Flocale=en). This plugin enables interaction with Near Field Communication (NFC) tags and provides cross-platform support for Android, iOS, and Web. The project is available as Sponsorware on [GitHub](https://github.com/capawesome-team/capacitor-plugins).

Let's take a quick look at the [Capacitor NFC API](/docs/plugins/nfc/#api) and how you can read and write on passive NFC tags and stickers. For this we will use the NTAG 215 from this [NFC Starter Kit](https://www.nfc-tag-shop.de/en/NFC-Starter-Kit-Medium-12-pieces/68250).

## Installation[¶](#installation "Permanent link")

To install the Capacitor NFC plugin, please refer to the [Installation](/docs/plugins/nfc/#installation) section in the plugin documentation.

## Usage[¶](#usage "Permanent link")

Now let's finally start and see the plugin in action.

### Read NFC tags[¶](#read-nfc-tags "Permanent link")

Reading NFC tags is quite simple:

`[](#%5F%5Fcodelineno-0-1)import { Nfc } from "@capawesome-team/capacitor-nfc";
[](#%5F%5Fcodelineno-0-2)
[](#%5F%5Fcodelineno-0-3)const read = async () => {
[](#%5F%5Fcodelineno-0-4)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-0-5)    Nfc.addListener("nfcTagScanned", async (event) => {
[](#%5F%5Fcodelineno-0-6)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-0-7)      resolve(event.nfcTag);
[](#%5F%5Fcodelineno-0-8)    });
[](#%5F%5Fcodelineno-0-9)
[](#%5F%5Fcodelineno-0-10)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-0-11)  });
[](#%5F%5Fcodelineno-0-12)};
`

First you have to add the `nfcTagScanned` listener. This listener is called when an NFC tag is scanned as well as when an NFC tag opens your app. As soon as the listener is active, you can start a new scan session with [Nfc.startScanSession(...)](/docs/plugins/nfc/#startscansession). During this session the operating system is looking for NFC tags. Once you are done, end the session with [Nfc.stopScanSession(...)](/docs/plugins/nfc/#stopscansession).

### Write NFC tags[¶](#write-nfc-tags "Permanent link")

An NFC tag can contain different types of data in different formats such as **NDEF**. NDEF means **NFC Data Exchange Format** and defines in which format data is stored on NFC tags and in which way it can be read.

Here we create a simple NDEF text record using [NfcUtils](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/nfc/docs/utils/README.md), a utility class with various helper functions:

`[](#%5F%5Fcodelineno-1-1)import { NfcUtils } from "@capawesome-team/capacitor-nfc";
[](#%5F%5Fcodelineno-1-2)
[](#%5F%5Fcodelineno-1-3)const createNdefTextRecord = () => {
[](#%5F%5Fcodelineno-1-4)  const utils = new NfcUtils();
[](#%5F%5Fcodelineno-1-5)  const { record } = utils.createNdefTextRecord({
[](#%5F%5Fcodelineno-1-6)    text: "Capacitor NFC Plugin",
[](#%5F%5Fcodelineno-1-7)  });
[](#%5F%5Fcodelineno-1-8)  return record;
[](#%5F%5Fcodelineno-1-9)};
`

This record can now be written to an NFC tag. A NFC tag may be written to at the moment it is scanned. That means we have to add the `nfcTagScanned` listener again.

`[](#%5F%5Fcodelineno-2-1)import { Nfc } from "@capawesome-team/capacitor-nfc";
[](#%5F%5Fcodelineno-2-2)
[](#%5F%5Fcodelineno-2-3)const write = async () => {
[](#%5F%5Fcodelineno-2-4)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-2-5)    const record = createNdefTextRecord();
[](#%5F%5Fcodelineno-2-6)
[](#%5F%5Fcodelineno-2-7)    Nfc.addListener("nfcTagScanned", async (event) => {
[](#%5F%5Fcodelineno-2-8)      await Nfc.write({ message: { records: [record] } });
[](#%5F%5Fcodelineno-2-9)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-2-10)      resolve();
[](#%5F%5Fcodelineno-2-11)    });
[](#%5F%5Fcodelineno-2-12)
[](#%5F%5Fcodelineno-2-13)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-2-14)  });
[](#%5F%5Fcodelineno-2-15)};
`

Now we can call [Nfc.write(...)](/docs/plugins/nfc/#write) and write the record to the NFC tag while the tag is being scanned.

### Make NFC tags read-only[¶](#make-nfc-tags-read-only "Permanent link")

It is possible to make NFC tags permanently read-only using the `makeReadOnly` method:

`[](#%5F%5Fcodelineno-3-1)import { Nfc } from "@capawesome-team/capacitor-nfc";
[](#%5F%5Fcodelineno-3-2)
[](#%5F%5Fcodelineno-3-3)const makeReadOnly = async () => {
[](#%5F%5Fcodelineno-3-4)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-3-5)    Nfc.addListener("nfcTagScanned", async (event) => {
[](#%5F%5Fcodelineno-3-6)      await Nfc.makeReadOnly();
[](#%5F%5Fcodelineno-3-7)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-3-8)      resolve();
[](#%5F%5Fcodelineno-3-9)    });
[](#%5F%5Fcodelineno-3-10)
[](#%5F%5Fcodelineno-3-11)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-3-12)  });
[](#%5F%5Fcodelineno-3-13)};
`

Warning 

This is a **one-way** operation and cannot be undone. Once an NFC tag has been made read-only, it can no longer be written to.

### Send custom commands to NFC tags[¶](#send-custom-commands-to-nfc-tags "Permanent link")

And finally, we can send custom commands to the NFC tag. Which NFC tag supports which commands can be found in the respective specification of the tag. The specification for NTAG 215 can be found [here](https://www.nxp.com/docs/en/data-sheet/NTAG213%5F215%5F216.pdf).

Note 

The codes in the specifications are often in hex format, but the plugin needs them as byte array. The [convertHexToBytes(...)](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/nfc/docs/utils/README.md#converthextobytes) method can help you with this.

In the following example we read the signature of the tag:

`[](#%5F%5Fcodelineno-4-1)import { Nfc } from "@capawesome-team/capacitor-nfc";
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const readSignature = async () => {
[](#%5F%5Fcodelineno-4-4)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-4-5)    Nfc.addListener("nfcTagScanned", async (event) => {
[](#%5F%5Fcodelineno-4-6)      const { response } = await Nfc.transceive({
[](#%5F%5Fcodelineno-4-7)        techType: NfcTagTechType.NfcA,
[](#%5F%5Fcodelineno-4-8)        data: [60, 0],
[](#%5F%5Fcodelineno-4-9)      });
[](#%5F%5Fcodelineno-4-10)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-4-11)      resolve(response);
[](#%5F%5Fcodelineno-4-12)    });
[](#%5F%5Fcodelineno-4-13)
[](#%5F%5Fcodelineno-4-14)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-4-15)  });
[](#%5F%5Fcodelineno-4-16)};
`

For this, we send the command (`[60, 0]`) to the tag using the [Nfc.transceive(...)](/docs/plugins/nfc/#transceive) method and receive the signature as a byte array.

## Closing Thoughts[¶](#closing-thoughts "Permanent link")

Be sure to check out our [API Reference](/docs/plugins/nfc/#api) to see what else you can do with this plugin. Also feel free to take a look at our [Demo App](https://github.com/capawesome-team/capacitor-nfc-demo) which shows this plugin in action.

May 7, 2026 

 Back to top 