> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscriptions | Polygon

> Polygon web3.js subscription methods — subscribe to new block headers, pending transactions, contract events, and other real-time blockchain updates.

<Info>
  Note that all subscriptions require a WebSocket connection.
</Info>

## Native EVM subscriptions

Developers can use the following native methods to subscribe to events:

<CardGroup>
  <Card title="eth_subscribe('newHeads')" href="/reference/polygon-native-subscribe-newheads" icon="angle-right" iconType="solid" horizontal />

  <Card title="eth_subscribe('newPendingTransactions')" href="/reference/polygon-native-subscribe-newpendingtransactions" icon="angle-right" iconType="solid" horizontal />

  <Card title="eth_subscribe('logs')" href="/reference/polygon-native-subscribe-logs" icon="angle-right" iconType="solid" horizontal />
</CardGroup>

The subscriptions created can be cleared using the following method:

<CardGroup>
  <Card title="eth_unsubscribe" href="/reference/polygon-native-unsubscribe" icon="angle-right" iconType="solid" horizontal />
</CardGroup>

## web3.js subscriptions

The [web3.js](https://web3js.readthedocs.io/en/v1.2.11/getting-started.html) library also offers subscription methods. web3.js subscriptions are the successors of the deprecated `web3.eth.filter` methods and provide a way for developers to receive real-time updates about events on the blockchain without constantly polling the blockchain for new data.

Subscriptions can be created using one of the following methods:

<CardGroup>
  <Card title="subscribe('newBlockHeaders')" href="/reference/polygon-subscribenewblockheaders" icon="angle-right" iconType="solid" horizontal />

  <Card title="subscribe('pendingTransactions')" href="/reference/polygon-subscribependingtransactions" icon="angle-right" iconType="solid" horizontal />

  <Card title="subscribe('logs')" href="/reference/polygon-subscribelogs" icon="angle-right" iconType="solid" horizontal />

  <Card title="subscribe('syncing')" href="/reference/polygon-subscribesyncing" icon="angle-right" iconType="solid" horizontal />
</CardGroup>

The subscriptions created can be cleared using the following method:

<CardGroup>
  <Card title="clearSubscriptions" href="/reference/polygon-clearsubscriptions" icon="angle-right" iconType="solid" horizontal />
</CardGroup>
