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

> Ethereum 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>

<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 cols={2}>
  <Card title="eth_subscribe('newHeads')" icon="angle-right" iconType="solid" href="/reference/ethereum-native-subscribe-newheads" horizontal />

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

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

The subscriptions created can be cleared using the following method:

<CardGroup cols={2}>
  <Card title="eth_unsubscribe" icon="angle-right" iconType="solid" href="/reference/ethereum-native-unsubscribe" 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 cols={2}>
  <Card title="subscribe('newBlockHeaders')" icon="angle-right" iconType="solid" href="/reference/ethereum-subscribenewblockheaders" horizontal />

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

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

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

The subscriptions created can be cleared using the following method:

<CardGroup cols={2}>
  <Card title="clearSubscriptions" icon="angle-right" iconType="solid" href="/reference/ethereum-clearsubscriptions" horizontal />
</CardGroup>
