> ## Documentation Index
> Fetch the complete documentation index at: https://help.airbridge.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Hybrid App Setup - Unreal SDK

<Info>
  **Notice**

  Before proceeding with the hybrid app setup, install the [Unreal SDK](/en/developers/unreal-sdk-v4) and [Web SDK](/en/developers/web-sdk).
</Info>

You can configure the Airbridge Unity SDK to handle Airbridge-related tasks within the hybrid app's in-app website without modifying the website's code.

## Handle Web SDK Commands with the Unreal SDK

The Unreal SDK can handle commands related to event transmission, device settings, and user settings that occur within the Web SDK.  Before displaying the website in the web view, configure the Unreal SDK using the `FAirbridge::CreateWebInterfaceScript` and `FAirbridge::HandleWebInterfaceCommand` functions.

* `webToken`: This is the [Web SDK token](/en/guides/tokens#web-sdk-token). Your Web SDK token can be found on the **\[Settings]>\[Tokens]** page in the Airbridge dashboard.
* `postMessageScript`: This JavaScript code transmits the payload variable, which stores the command passed from the Web SDK to the Unreal SDK to the Unity area.
* `command`: This command is passed from the Web SDK to the Unreal SDK.

```c lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
void UWebViewClass::OnLoadStarted()
{
    FString PostMessageScript = FAirbridge::CreateWebInterfaceScript(
        TEXT("YOUR_WEB_SDK_TOKEN"),
        [](const FString& Msg) -> FString
        {
            return TEXT("...");
        }("payload")
    );

    UWebViewClass->ExecuteJavascript(PostMessageScript);
}

void UWebViewClass::OnMessageReceived(const FString& Command)
{
    FAirbridge::HandleWebInterfaceCommand(Command);
}
```

## Attention

<Accordion title="In-app web view event collection">
  Note that with the hybrid app setup, events that occur in the in-app web view must be collected through the Web SDK only. If collected through the App SDK as well, event duplication will occur. If your in-app web view uses a live mobile website, utilize only the Web SDK for event collection.
</Accordion>

<link rel="alternate" hrefLang="en" href="https://help.airbridge.io/en/developers/hybrid-app-settings-unreal-sdk-v4" />

<link rel="alternate" hrefLang="ko" href="https://help.airbridge.io/ko/developers/hybrid-app-settings-unreal-sdk-v4" />
