# 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`.

```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](/docs/platform/canvas-framework/guide/canvas-app-events.md)
- [Creating a Canvas App Event](/docs/platform/canvas-framework/guide/canvas-app-event-publish-code-example.md)
