unsubscribe( )


Removes 1 or more subscriptions.

You can unsubscribe in 3 ways:

  • By subscriptionId: removes a single subscription.
  • By channel: removes all subscriptions to that channel or resource.
  • By both: removes the specific subscription, verifying it matches the channel.

When the last subscription on a connection is removed, the connection closes automatically.

Method Declaration
Copy
Method Parameters
optionsUnsubscribeOptionsRequired

Unsubscribe details. You must specify channel, subscriptionId, or both.

Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?