---
schema_version: "1"
id: 734494578061ebbc6cea6f7f228125e92f69aa16d23087767df50b70a6b0486c
title: Creating a Canvas App 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/events/canvas-app-event-publish-code-example.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-event-publish-code-example.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: da53a65481c26794d6cf1a1ec518f5a111200c70d869fee6a898d072aed1a12a
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Creating a Canvas App Event

The following code example shows how to call the `publish` method to create a canvas app event. If you’re using a namespace, the event name must be prefaced by the namespace. For example, `namespace.eventName`.

<!-- otherprops: set_clipboard -->
```java
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.publish(sr.client,
        {name : "mynamespace.statusChanged", payload : {status : 'Completed'}});
});
```

**See Also**  


-   [Implementing Canvas App Events](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-events.md)
-   [Creating a Canvas App Event](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-event-publish-code-example.md)

