# Client setup (/docs/updates/clients)



`npx liftbay ota init` sets up the channels and tells you what to add to your app. It uses the update library your app already depends on; in a plain React Native app without one, it asks which to use (`--client expo-updates|codepush|hot-updater` picks it without asking). Each channel also shows its connection values in the dashboard: open the channel under **Updates** and see **Connect your app**.

## expo-updates [#expo-updates]

`ota init` sets this up completely. In `app.json`, the config plugin carries the update URL and sets the channel for each build:

```json title="app.json"
{
  "expo": {
    "runtimeVersion": { "policy": "appVersion" },
    "plugins": [["@liftbay/expo-plugin", { "updatesUrl": "https://u.liftbay.dev/ota/expo/<project-id>" }]]
  }
}
```

Liftbay builds bake in the build profile's channel (`preview` for a preview build). For local builds, set `LIFTBAY_CHANNEL` before `expo prebuild`; without it the channel is `production`.

With [signed updates](/docs/updates/signing), `liftbay update signing init` adds `"codeSigningCertificate": "./certs/liftbay-certificate.pem"` to the plugin options; the plugin sets expo-updates' `codeSigningCertificate` and `codeSigningMetadata` (`keyid: "main"`, `alg: "rsa-v1_5-sha256"`).

## CodePush [#codepush]

Use [`@code-push-next/react-native-code-push`](https://github.com/CodePushNext/react-native-code-push) on React Native 0.76 and later (Microsoft's `react-native-code-push` works on older versions). Set it up as its README says, with Liftbay's server and the channel's deployment keys:

| Setting        | iOS (`Info.plist`)                                          | Android (`strings.xml`, `moduleConfig="true"`)   |
| -------------- | ----------------------------------------------------------- | ------------------------------------------------ |
| Server URL     | `CodePushServerURL` = `https://u.liftbay.dev/ota/codepush/` | `CodePushServerUrl` = the same                   |
| Deployment key | `CodePushDeploymentKey` = `<channel-id>.ios`                | `CodePushDeploymentKey` = `<channel-id>.android` |

`liftbay.json` has `"updates": { "client": "codepush" }` (`ota init` writes it), so `liftbay update publish` bundles with `react-native bundle` and Hermes, the way the CodePush CLI does. A release is for the app version in the native project (`versionName`, `MARKETING_VERSION`); `--target-version 1.5.x` targets a range.

Rolling back sends devices to the previous release. CodePush apps can't be sent back to the bundle inside the app: the client never asks for it. To undo the only release, publish the code the app was built with.

## hot-updater [#hot-updater]

Both hot-updater 1.x and 0.x work. Set the base URL in your app:

```ts title="hot-updater 1.x"
export const hotUpdater = HotUpdater.init({ baseURL: "https://u.liftbay.dev/ota/hot-updater/<project-id>" });
export default hotUpdater.wrap({ updateStrategy: "appVersion" })(App);
```

```ts title="hot-updater 0.x"
export default HotUpdater.wrap({ baseURL: "https://u.liftbay.dev/ota/hot-updater/<project-id>", updateStrategy: "appVersion" })(App);
```

Set the channel the build uses (default `production`):

|         | iOS (`Info.plist`)    | Android (`AndroidManifest.xml`)                                                  |
| ------- | --------------------- | -------------------------------------------------------------------------------- |
| Channel | `HOT_UPDATER_CHANNEL` | `<meta-data android:name="com.hotupdater.CHANNEL" android:value="production" />` |

`liftbay.json` has `"updates": { "client": "hot-updater" }`, so `liftbay update publish` bundles with `react-native bundle` and Hermes. With the `appVersion` strategy a release is for the app version in the native project, or `--target-version` for a range; for the `fingerprint` strategy pass the build's fingerprint with `--runtime-version`.

On hot-updater 1.x, the device works out whether it's in a partial rollout itself, from the release catalog Liftbay serves, so rollout percentages behave the same as on the other clients.
