The **tagSession** module provides common APIs for establishing connections and transferring data.
> **NOTE**
>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## **Modules to Import**
```js
importtagfrom'@ohos.nfc.tag';
```
## tagSession
Provides common APIs for establishing connections and transferring data. **tagSession** is the base class of all [NFC tag technologies](js-apis-nfctech.md).
A child class instance is required to access the following interfaces. You can use **get**XX**Tag()** to obtain a child class instance.
The specific method varies with the NFC tag technology in use. For details, see [nfcTag](js-apis-nfcTag.md).
### tagSession.connectTag
connectTag(): boolean;
Connects to this tag.
Call this method to set up a connection before reading data from or writing data to a tag.