---
agentTools:
  projectIndex: https://developers.pipefy.com/llms.txt
---

# Where each function works

Which PipefyApp functions are available at which mount point

Your app does not run in one iframe — it runs in a different iframe for every surface it appears on. Pipefy hands each of those iframes a different set of capabilities, so a few `PipefyApp.*` methods only work in some of them.

This is the most common source of "why does nothing happen when I call this?" Check the table before debugging.

## Mount points

A **mount point** is the surface Pipefy rendered your page into.

| Mount point     | What it is                                                                                   | How your page gets there                     |
| :-------------- | :------------------------------------------------------------------------------------------- | :------------------------------------------- |
| **Root frame**  | The hidden page at your manifest's `init_url`. It registers your features and renders no UI. | Pipefy loads it once when your app is active |
| **Card tab**    | A tab inside an open card                                                                    | `'card-tab'` returns a `url`                 |
| **Modal**       | A centred overlay                                                                            | `p.modal({ url, width, height })`            |
| **Dropdown**    | A panel under a button — only when you pass `url` instead of `items`                         | `p.dropdown({ url })`                        |
| **Sidebar**     | A panel docked to the side of the pipe                                                       | `p.sidebar({ url, title })`                  |
| **Pipe view**   | A full-width view that replaces the Kanban board                                             | `'pipe-view'` returns a `url`                |
| **OAuth popup** | A separate window used to finish a third-party OAuth flow                                    | `p.oAuthAuthorize(url, dimensions)`          |

## Availability

| Method                                   | Available in              | Notes                                                              |
| :--------------------------------------- | :------------------------ | :----------------------------------------------------------------- |
| `PipefyApp.init()`                       | everywhere                | Returns the client (`p`)                                           |
| `PipefyApp.client()`                     | everywhere                | Returns the client without re-initialising                         |
| `PipefyApp.initCall(features)`           | **root frame only**       | Throws elsewhere                                                   |
| `PipefyApp.render(callback)`             | **card tab, pipe view**   | **Required** on both — see below. Throws elsewhere.                |
| `PipefyApp.resizeTo(selector)`           | card tab, modal, dropdown | Throws in sidebar and pipe view                                    |
| `PipefyApp.onCardDragStart(cb)`          | **sidebar only**          | Throws elsewhere                                                   |
| `PipefyApp.onCardDragEnd(cb)`            | **sidebar only**          | Throws elsewhere                                                   |
| `PipefyApp.onCardDrop(cb)`               | **sidebar only**          | Throws elsewhere                                                   |
| `PipefyApp.registerListener(name, cb)`   | **pipe view only**        | Throws elsewhere                                                   |
| `PipefyApp.pipeFilter(pipeId)`           | **pipe view only**        | Throws elsewhere                                                   |
| `PipefyApp.oAuthRedirect()`              | **OAuth popup only**      | Does nothing useful elsewhere. Throws if called twice on one page. |
| `PipefyApp.onFinishAuthentication(code)` | **OAuth popup only**      | Throws elsewhere                                                   |

Every method on the client object itself — `p.card()`, `p.query()`, `p.set()`, `p.sidebar()` and the rest — is available wherever you have a client.

> ⚠️ `PipefyApp.render()` is not optional
>
> Card tabs and pipe views must call `PipefyApp.render(callback)` when the page has finished loading. A pipe view that never calls it redirects the user back to the Kanban board. See [User Interface functions](https://developers.pipefy.com/docs/user-interface-functions#pipefyapprendercallback).

## Why this happens

Pipefy passes each iframe a set of functions over the frame boundary, and it only passes the ones that make sense for that surface. `PipefyApp.onCardDrop()` needs a drag-and-drop stream that only the sidebar has; `PipefyApp.pipeFilter()` needs a card list that only the pipe view has.

Each `PipefyApp.*` method above is a thin wrapper that reaches for the matching function Pipefy handed this iframe. On a surface where Pipefy didn't pass it, there is nothing to call, so you get a synchronous `TypeError` in your own page ending in `... is not a function`.

The name in that message is Pipefy's internal name for the capability, not the SDK method you called. Three don't match, which is what makes the error hard to trace back:

| You called                           | The error names  |
| :----------------------------------- | :--------------- |
| `PipefyApp.render()`                 | `renderCallback` |
| `PipefyApp.resizeTo()`               | `resize`         |
| `PipefyApp.onFinishAuthentication()` | `onFinish`       |

The rest report the same name as the method. That indirection is why this page exists.

Two methods behave differently:

* **`PipefyApp.resizeTo()`** throws for its own reasons too — a selector that isn't an `#id`, or an `#id` matching no element — not only on the wrong mount point.
* **`PipefyApp.oAuthRedirect()`** does not throw on the wrong mount point; it just doesn't accomplish anything there. It *does* throw if you call it twice on the same page, with `Can not register multiple components with the same tag`.

## Writing code that runs on more than one surface

If you share a bundle across several mount points — which the [React sample app](https://github.com/Pipefyteam/sample-app-react) does — guard the surface-specific calls rather than assuming they exist:

```javascript
var p = PipefyApp.init();

// Safe anywhere
p.card().then(renderCard);

// Only meaningful in a sidebar
if (isSidebar) {
  PipefyApp.onCardDrop(function (payload) {
    console.log('card dropped', payload);
  });
}
```

The simplest way to know which surface you are on is to give each one its own route or page, as the sample app does, rather than detecting it at runtime.