> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/avalanche-web3js-subscriptions-methods",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Subscriptions | Avalanche

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

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

<Check>
  ### Get your own node endpoint today

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Native EVM subscriptions

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

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

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

  <Card title="eth_subscribe('logs')" href="/reference/avalanche-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/avalanche-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/avalanche-subscribenewblockheaders" icon="angle-right" iconType="solid" horizontal />

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

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

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

The subscriptions created can be cleared using the following method:

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