webflow.getCurrentAppConnection()

Get the current App Connection identifier, if any.

Use this method on initial load of an App to determine whether the App was launched via an “App Connection” button in the Designer. The App can then choose to show a different experience based on the information recieved.

Syntax

1webflow.getCurrentAppConnection(): Promise<null | string>

Returns

Promise<string | null>

If the App was launched from an App connection, this method will return a Promise that resolves to the string identifier for the App Connection. Otherwise, it returns a Promise resolving to null.

Example

This example is for an App written in React. This code would be placed on the index page of the App

1React.useEffect(() => {
2 async function onLoad() {
3 /*
4 Await the current App Connection information. If the App was launched via a specific App Connection button, this will return a string with the connection name; otherwise, it returns null.
5 */
6 const appConnection = await webflow.getCurrentAppConnection();
7
8 /*
9 Check if the App Connection matches 'myAwesomeAppManageFormElement'.
10 If it does, the App will redirect to the '/editForms' page to provide a tailored experience based on the App Connection.
11 */
12 if (appConnection === "myAwesomeAppManageFormElement") {
13 redirectToPage("/editForms");
14 }
15 }
16
17 // Call the onLoad function when the component mounts.
18 onLoad();
19}, []);

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny