---
title: "subscribe Method"
canonical: https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.editor.subscribe.htm
archived: true
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Design Editor"
    versions: ["6.15.0", "6.x (may differ)"]
---

**You’re viewing outdated documentation.** [View the latest Customer’s Canvas On-Premises documentation](https://customerscanvas.com/docs/on-premises/).

# subscribe Method

**Applies to:** Customer's Canvas On-Premises; Design Editor 6.15.0, 6.x (may differ) · **Archived documentation**
 
### Callable
 
- subscribe(event:  string, handler:  function ) :  void

- Links an event with a handler function. [PostMessage.Events](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.postmessage.events.htm.md) object contains the supported events.
  
 - example
     - The following snippet subscribes to the [Events.BoundsNotification](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.postmessage.events.htm.md) event and outputs the event arguments to the console:
 
```
    var editor = null;
    CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition)
        .then((e) => {
            editor = e;
            editor.subscribe(CustomersCanvas.IframeApi.PostMessage.Events.BoundsNotification, (args) => {
                    console.log("BoundsNotification fired."); 
                    console.log(JSON.stringify(args, null, 4)); 
                });
            editor.subscribe(CustomersCanvas.IframeApi.PostMessage.Events.PrintAreaBoundsChanged, (args) => {
                    console.log("PrintAreaBoundsChanged");
                    console.log(args);
                });
        });
    ```

#### Parameters

    - ##### event: string 
  
        The event to link the handler function with.
    - ##### handler: function 
  
        The handler function to link with the given event.

        - - ( ...args:  any [] ) :  void

            - #### Parameters

                - #####  Rest ...args: any []

#### Returns void

#### Returns void
