---
schema_version: "1"
id: 47fb40f2a9a611fb76530c942b2d2af29a9f0adeb1f7d4fb87665032b110b057
title: Setting Up the Pubsub SDK (Winter '20)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-setting-up-the-pubsub-sdk__winter__20-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-setting-up-the-pubsub-sdk__winter__20-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 595253ef3b8242311d8917fcb473ee86c02a2f3683a6ff44fe7ed34e7cbc59b8
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Setting Up the Pubsub SDK (Winter '20)

The Vlocity Digital Commerce SDK includes the [pubsub](https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.events_pubsub) SDK, which supports communication between Digital Commerce components, including Digital Commerce Lightning Web Components, Digital Commerce Web Components, JavaScript-based framework, and so on. For more details, see the [PubSub SDK reference](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_events_pubsub_sdk_.pubsub.html).

## Registering an Event

Use the following example Digital Commerce pubsub register method to add a callback function to the list of subscribers for a particular event:

```nolang
// registering pub-sub event
this.callbackEventHandler = {
      result: this.callbackFunction.bind(this)
};
callbackFunction(data) {/* callback triggered by the pubsub event */}
this.digitalCommerceSDK.register("event-name",this.callbackEventHandler);
```

## Firing an Event

Use the following example fire method to publish the occurrence of an event:

```nolang
this.digitalCommerceSDK.fire("event-name",action,payloadObject);
```

## Unregistering an Event

Use the following example unregister method to cancel subscription of an event:

```nolang
// un-registering pub-sub event
this.digitalCommerceSDK.unregister("event-name",this.callbackEventHandler);
```
