Skip to content

@tauri-apps/plugin-nfc

function isAvailable(): Promise<boolean>;

Defined in: plugins/nfc/guest-js/index.ts:271

Promise<boolean>


function record(
format: NFCTypeNameFormat,
kind: string | number[],
id: string | number[],
payload: string | number[]): NFCRecord;

Defined in: plugins/nfc/guest-js/index.ts:110

Parameter Type
format NFCTypeNameFormat
kind string | number[]
id string | number[]
payload string | number[]

NFCRecord


function scan(kind: ScanKind, options?: ScanOptions): Promise<Tag>;

Defined in: plugins/nfc/guest-js/index.ts:231

Scans an NFC tag.

import { scan } from "@tauri-apps/plugin-nfc";
await scan({ type: "tag" });

See https://developer.android.com/develop/connectivity/nfc/nfc#ndef for more information.

Parameter Type Description
kind ScanKind -
options? ScanOptions -

Promise<Tag>


function textRecord(
text: string,
id?: string | number[],
language?: string): NFCRecord;

Defined in: plugins/nfc/guest-js/index.ts:130

Parameter Type Default value
text string undefined
id? string | number[] undefined
language? string 'en'

NFCRecord


function uriRecord(uri: string, id?: string | number[]): NFCRecord;

Defined in: plugins/nfc/guest-js/index.ts:203

Parameter Type
uri string
id? string | number[]

NFCRecord


function write(records: NFCRecord[], options?: WriteOptions): Promise<void>;

Defined in: plugins/nfc/guest-js/index.ts:256

Write to an NFC tag.

import { uriRecord, write } from "@tauri-apps/plugin-nfc";
await write([uriRecord("https://tauri.app")], { kind: { type: "ndef" } });

If you did not previously call scan with ScanOptions.keepSessionAlive set to true, it will first scan the tag then write to it.

Parameter Type Description
records NFCRecord[] -
options? WriteOptions -

Promise<void>

Defined in: plugins/nfc/guest-js/index.ts:80

Enumeration Member Value Defined in
AbsoluteURI 3 plugins/nfc/guest-js/index.ts:84
Empty 0 plugins/nfc/guest-js/index.ts:81
Media 2 plugins/nfc/guest-js/index.ts:83
NfcExternal 4 plugins/nfc/guest-js/index.ts:85
NfcWellKnown 1 plugins/nfc/guest-js/index.ts:82
Unchanged 6 plugins/nfc/guest-js/index.ts:87
Unknown 5 plugins/nfc/guest-js/index.ts:86

Defined in: plugins/nfc/guest-js/index.ts:16

Enumeration Member Value Defined in
IsoDep 0 plugins/nfc/guest-js/index.ts:17
MifareClassic 1 plugins/nfc/guest-js/index.ts:18
MifareUltralight 2 plugins/nfc/guest-js/index.ts:19
Ndef 3 plugins/nfc/guest-js/index.ts:20
NdefFormatable 4 plugins/nfc/guest-js/index.ts:21
NfcA 5 plugins/nfc/guest-js/index.ts:22
NfcB 6 plugins/nfc/guest-js/index.ts:23
NfcBarcode 7 plugins/nfc/guest-js/index.ts:24
NfcF 8 plugins/nfc/guest-js/index.ts:25
NfcV 9 plugins/nfc/guest-js/index.ts:26

Defined in: plugins/nfc/guest-js/index.ts:103

Property Type Defined in
format NFCTypeNameFormat plugins/nfc/guest-js/index.ts:104
id number[] plugins/nfc/guest-js/index.ts:106
kind number[] plugins/nfc/guest-js/index.ts:105
payload number[] plugins/nfc/guest-js/index.ts:107

Defined in: plugins/nfc/guest-js/index.ts:62

Property Type Description Defined in
keepSessionAlive? boolean - plugins/nfc/guest-js/index.ts:63
message? string Message displayed in the UI. iOS only. plugins/nfc/guest-js/index.ts:65
successMessage? string Message displayed in the UI when the message has been read. iOS only. plugins/nfc/guest-js/index.ts:67

Defined in: plugins/nfc/guest-js/index.ts:97

Property Type Defined in
id number[] plugins/nfc/guest-js/index.ts:98
kind string[] plugins/nfc/guest-js/index.ts:99
records TagRecord[] plugins/nfc/guest-js/index.ts:100

Defined in: plugins/nfc/guest-js/index.ts:90

Property Type Defined in
id number[] plugins/nfc/guest-js/index.ts:93
kind number[] plugins/nfc/guest-js/index.ts:92
payload number[] plugins/nfc/guest-js/index.ts:94
tnf NFCTypeNameFormat plugins/nfc/guest-js/index.ts:91

Defined in: plugins/nfc/guest-js/index.ts:10

Property Type Defined in
host? string plugins/nfc/guest-js/index.ts:12
pathPrefix? string plugins/nfc/guest-js/index.ts:13
scheme? string plugins/nfc/guest-js/index.ts:11

Defined in: plugins/nfc/guest-js/index.ts:70

Property Type Description Defined in
kind? ScanKind - plugins/nfc/guest-js/index.ts:71
message? string Message displayed in the UI when reading the tag. iOS only. plugins/nfc/guest-js/index.ts:73
successfulReadMessage? string Message displayed in the UI when the tag has been read. iOS only. plugins/nfc/guest-js/index.ts:75
successMessage? string Message displayed in the UI when the message has been written. iOS only. plugins/nfc/guest-js/index.ts:77

type ScanKind =
| {
mimeType?: string;
type: "tag";
uri?: UriFilter;
}
| {
mimeType?: string;
techLists?: TechKind[][];
type: "ndef";
uri?: UriFilter;
};

Defined in: plugins/nfc/guest-js/index.ts:29

{
mimeType?: string;
type: "tag";
uri?: UriFilter;
}

{
mimeType?: string;
techLists?: TechKind[][];
type: "ndef";
uri?: UriFilter;
}
Name Type Description Defined in
mimeType? string - plugins/nfc/guest-js/index.ts:38
techLists? TechKind[][] Each of the tech-lists is considered independently and the activity is considered a match if any single tech-list matches the tag that was discovered. This provides AND and OR semantics for filtering desired techs. See https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED for more information. Examples import type { TechKind } from "@tauri-apps/plugin-nfc" const techLists = [ // capture anything using NfcF [TechKind.NfcF], // capture all MIFARE Classics with NDEF payloads [TechKind.NfcA, TechKind.MifareClassic, TechKind.Ndef] ] plugins/nfc/guest-js/index.ts:59
type "ndef" - plugins/nfc/guest-js/index.ts:36
uri? UriFilter - plugins/nfc/guest-js/index.ts:37

const RTD_TEXT: number[];

Defined in: plugins/nfc/guest-js/index.ts:7


const RTD_URI: number[];

Defined in: plugins/nfc/guest-js/index.ts:8


© 2026 Tauri Contributors. CC-BY / MIT