> For the complete documentation index, see [llms.txt](https://sub2.gitbook.io/sub2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sub2.gitbook.io/sub2/sdk/listen-for-canceled-subscriptions.md).

# Listen for canceled subscriptions

Similar to how we can use the sub2 SDK to listen to new subscriptions for a given recipient, we can also listen to canceled subscriptions. It is assumed that sub2-sdk is installed and setup as done [here](/sub2/sdk.md).

```typescript
const unwatch: WatchEventReturnType = sub2SDK.watchCanceledSubscriptions(recipientAddress, callbackFn);
```

Here `recipientAddress` is of type `` `0x{string}` `` and callbackFn is of type `(subscriptionIndex: bigint) => any`. The callback function is defined by you and is what is called on newly observed canceled  subscriptions. For example, you can make a callback function which checks that the subscription index corresponds to an active subscription in your backend and update access accordingly.&#x20;

The returned value `unwatch` of the viem type `WatchEventReturnType` is a function that can be called to stop listening for events.
