Files
supabase/apps/reference/_supabase_js_versioned_docs/version-v1/removesubscription.mdx
2022-08-15 11:18:27 +02:00

54 lines
1.3 KiB
Plaintext

---
id: removesubscription
title: 'removeSubscription()'
slug: removesubscription
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1_legacy.yml
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Closes and removes a subscription and returns the number of open subscriptions.
```js
supabase.removeSubscription(mySubscription)
```
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
subscription
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>default</code>
</span>
</h4>
<div class="method-list-item-description">
The subscription you want to close and remove.
</div>
</li>
</ul>
## Notes
- Removing subscriptions is a great way to maintain the performance of your project's database. Supabase will automatically handle cleanup 30 seconds after a user is disconnected, but unused subscriptions may cause degradation as more users are simultaneously subscribed.
## Examples
### Remove a subscription
```js
supabase.removeSubscription(mySubscription)
```