---
schema_version: "1"
id: 08ea40589c42adc266057e8b92068c37d954f50db689a80e6824f8bc0c9de82a
title: Using the Streaming API Event
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/canvas-framework/guides/platform-connect/using/streaming-api/canvas-app-streaming-event-code-example.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-streaming-event-code-example.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 348bf3f58b39560b625166d70949ebdedb7f9992747f9e1ed2b6a0fe80cbc96c
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Using the Streaming API Event

The Canvas SDK contains an event called `sfdc.streamingapi` that lets you define an event in your canvas app and associate that event with a Streaming API channel. You then use the `subscribe` method to subscribe to the event and receive Streaming API notifications.

For example, in Salesforce, you can create a Streaming API channel that receives notifications when an InvoiceStatement is updated and the Status changes to Closed. In your canvas app, you can then create an event associated with that channel and subscribe to it. In Salesforce, whenever an invoice statement is closed, the activated canvas app receives the notification and can perform an action such as displaying a message to the user.

Here are some considerations when defining the Streaming API event:

-   The event takes a single parameter that contains the PushTopic name.
-   The PushTopic name must be prefaced by “/topic/.”

<!-- otherprops: set_clipboard -->
```java
{name:"sfdc.streamingapi", params:{topic:"/topic/myPushTopicName"}}
```

**See Also**  


-   [Using Streaming API in a Canvas App](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-streaming-api.md)
-   [Subscribing to a Streaming API Event](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-streaming-subscribe-code-example.md)

