> For the complete documentation index, see [llms.txt](https://mercure-technologies.gitbook.io/xprem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mercure-technologies.gitbook.io/xprem/installation-guide/configure-your-application.md).

# Configure your application

### Open the dashboard

Open `{{SERVER_URL}}/dashboard` and login using the ADMIN\_EMAIL & ADMIN\_PASSWORD defined [here](/xprem/installation-guide/server-configuration.md#dashboard-credentials).

### Create your app

<details>

<summary>Import existing Expo Application</summary>

<figure><img src="https://2155714808-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Frv7YwbmypjuLMR4sh6Qt%2Fuploads%2F0sa7VC3p0v2Il0phMXdr%2Fimage.png?alt=media&amp;token=fd3b825a-4ada-4d6d-85cd-1fbf29a4ccd2" alt="" width="253"><figcaption></figcaption></figure>

<figure><img src="https://2155714808-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Frv7YwbmypjuLMR4sh6Qt%2Fuploads%2F6rVP0yIMoiUPlBgasAzF%2Fimage.png?alt=media&amp;token=166e2df4-a393-4899-bf55-dd207435d981" alt="" width="375"><figcaption></figcaption></figure>

You can retrieve your Expo Access Token [on this page](https://expo.dev/accounts/\[account]/settings/access-tokens). It won't be stored in the database; it's only used to set up the import workers.

The import will fetch and store your app, branches and release channels, keeping their original UUIDs.

You can also import your existing update history by checking "Also copy the update history".

<figure><img src="https://2155714808-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Frv7YwbmypjuLMR4sh6Qt%2Fuploads%2FftkQWnUgk51yYiA92CTu%2Fimage.png?alt=media&amp;token=0915f5b2-a2a1-4e36-bae1-f92393f8f98a" alt="" width="375"><figcaption></figcaption></figure>

You can import as many apps as you want from your Expo account, but you'll need to enter your access token each time, since it's never persisted in the database.

</details>

<details>

<summary>Create new application from scratch</summary>

<figure><img src="https://2210815540-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3lDfFt997XARABknq9E7%2Fuploads%2Fp29bEmr3DmAOmluEEfXX%2Fimage.png?alt=media&#x26;token=75e1d4da-9480-4f16-beda-397f71c88de6" alt="" width="253"><figcaption></figcaption></figure>

<p align="center"><img src="https://2155714808-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Frv7YwbmypjuLMR4sh6Qt%2Fuploads%2F9TNqPnBTTaywUsPqvUd4%2Fimage.png?alt=media&amp;token=b194e2a5-34fd-43a5-8271-46477da5c87c" alt="" data-size="original"></p>

Then go to **App Info** and copy your App ID.

<figure><img src="https://2210815540-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3lDfFt997XARABknq9E7%2Fuploads%2Fe6DJAMuNGd2WD6cYwAOc%2Fimage.png?alt=media&#x26;token=91a9fdc4-c40c-41b8-b5c8-d1e5c931cf0c" alt=""><figcaption></figcaption></figure>

</details>

### Download the signing certificate

Go to **App Info** and click **Download certificate** in the top-right corner.

Save it into your Expo project as `certs/certificate.pem`:

```bash
mkdir -p certs
mv ~/Downloads/app-<your-app-id>-certificate.txt certs/certificate.pem
```

Your app uses this certificate to verify that updates really came from your server. Commit it to your Expo project.

### Create an API Key

Go to **API tokens** and create a new token:

{% hint style="info" %}
Make sure to copy your token now. You won't be able to see it again.
{% endhint %}

<figure><img src="https://2210815540-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3lDfFt997XARABknq9E7%2Fuploads%2FuXGnCO4rUe9iBCDdK9R8%2Fimage.png?alt=media&#x26;token=7ed58dcf-4e08-422a-8868-954a20724b43" alt=""><figcaption></figcaption></figure>

### Configure your Expo app

From the root of your Expo project, run:

```shellscript
npx eoas init
```

| Prompt                                             | Answer                                                                                               |
| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Project id (sent as expo-app-id the in the header) | **Your dashboard app UUID (if you imported your app from Expo you can "reuse" your EAS Project ID)** |
| URL of your update server                          | BASE\_URL                                                                                            |
| Do you have already generated your certificates    | **Yes**                                                                                              |

The command also adds three keys to `updates.requestHeaders` in your app config: `expo-channel-name`, `expo-app-id` and `xprem-branch`. Keep all three: `expo-updates` only sends headers that were declared at build time, and `xprem-branch` is what makes [branch surfing](/xprem/features/branch-surfing.md) possible on this build. Keep `expo-channel-name` as a literal string rather than a `process.env` value; the config is evaluated at export time, and an unset variable silently removes the key.

### Publish your first update

```shellscript
export RELEASE_CHANNEL={{APP_RELEASE_CHANNEL}}
export EOO_TOKEN={{API_KEY}}
npx eoas publish --branch {{BRANCH}}
```

### Point a channel at your branch

{% hint style="info" %}
If you imported your app from Expo, the channel / branch mapping has also been imported.
{% endhint %}

Each Expo build is bound to a release channel at build time, and each update is published to a branch. A channel points to one branch, and by default that mapping determines which updates the build receives. A channel can later serve other branches through [progressive rollouts](/xprem/eoas/progressive-rollouts.md) or [branch surfing](/xprem/features/branch-surfing.md), but a fresh channel behaves exactly like this.\
Go to Channels -> Create Channel and attach it to the branch you've just created.

<figure><img src="https://2210815540-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3lDfFt997XARABknq9E7%2Fuploads%2FodQIcKeOH76I977DArsg%2Fimage.png?alt=media&#x26;token=4ac2ca9c-8245-4c10-aef0-8987fd68f83c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The "production" channel is used in this demo but you should use the one attached to your expo build
{% endhint %}

### Submit your application

Your app now needs a new native build. The server URL and signing certificate are embedded at build time, so any build made before this change will keep pointing at the old configuration.

Build, submit to the App Store and Google Play, and once your users are on that version, every JavaScript change after it ships over the air.
