# Widget

A widget consists of JavaScript code that is uploaded as part of an integration. The code is evaluated in the frontend of a Pigello portal and can, for example, modify the UI, inject content or add custom routes.

Widgets are built with the [Pigello Widget SDK](/tools/widgets), which gives you typed access to the current user's session, the activation variables configured for the widget and portal-specific methods such as navigation.

The steps below take you from an empty application to a published widget.

## 1. Set up an application

Every widget belongs to an application. If you don't have one yet, follow the steps in [Setting up an application](/introduction/setting-up-an-application).

## 2. Create a project with the Pigello Widget SDK

Set up a project with the [Pigello Widget SDK](/tools/widgets) and write your widget.

We recommend the **Web Worker** runtime. It runs your widget in an isolated background thread, which keeps it sandboxed from the portal. Because of this isolation, all SDK methods are async in this runtime. The **Inline** runtime runs directly inside the portal page and is only approved for specific, vetted cases.

When your widget is done, bundle it into a single, self-contained JavaScript file. This is the file you upload in the next step.

## 3. Register and upload your widget

Sign in to the Pigello Developer Portal and open your application.
Click **Add Widget** and fill out the form. Choose **JS Script** and **Web Worker**, select which portals the widget should run in, and upload the bundled JavaScript file.

The widget is saved as a draft until it has been reviewed.

## 4. Request a review for publishing

When your widget is ready to be published, ask your contact person at Pigello to review it and remove its draft status. If you are building on behalf of a customer, ask the customer to contact Pigello instead.