{"id":24836832,"url":"https://github.com/rootpush/updates","last_synced_at":"2025-10-14T11:31:41.317Z","repository":{"id":273772973,"uuid":"920835076","full_name":"rootpush/updates","owner":"rootpush","description":"OTA updates in React Native, with rollback support.","archived":false,"fork":false,"pushed_at":"2025-03-25T13:42:06.000Z","size":1888,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T14:43:14.766Z","etag":null,"topics":["codepush","expo","ota","react-native","updates"],"latest_commit_sha":null,"homepage":"https://rootpush.com","language":"Objective-C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootpush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T21:13:18.000Z","updated_at":"2025-09-03T15:22:46.000Z","dependencies_parsed_at":"2025-01-22T22:30:00.882Z","dependency_job_id":null,"html_url":"https://github.com/rootpush/updates","commit_stats":null,"previous_names":["rootpush/updates"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rootpush/updates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootpush%2Fupdates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootpush%2Fupdates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootpush%2Fupdates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootpush%2Fupdates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootpush","download_url":"https://codeload.github.com/rootpush/updates/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootpush%2Fupdates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019089,"owners_count":26086516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codepush","expo","ota","react-native","updates"],"created_at":"2025-01-31T05:43:56.383Z","updated_at":"2025-10-14T11:31:41.309Z","avatar_url":"https://github.com/rootpush.png","language":"Objective-C++","readme":"# @rootpush/updates\n\nA lightweight Over-The-Air (OTA) update solution for React Native applications with built-in rollback support. This library allows you to deliver bundle updates to your React Native app without going through the app store review process.\n\n## Features\n\n- Supports bridgeless and new arch.\n- Supports branches for QA or internal testing.\n- Built-in rollback support\n- TypeScript support\n- CLI tool for easy deployments\n\n## Getting Started\n\n1. Create your account at [https://rootpush.com](https://rootpush.com)\n2. Create an application in the dashboard\n3. Create a deployment key for your application\n\n## Automatic Installation\n\nInstall the CLI.\n\nSee usage examples at: https://github.com/rootpush/cli?tab=readme-ov-file#usage\n\n```sh\nnpm i -g @rootpush/cli\n```\n\nThis will install the @rootpush/updates package, configure your iOS and Android files and install the pod.\n\n```sh\nrootpush install --product updates\n```\n\nYou can check all the changes with git. If you have a custom setup, installation can fail.\n```sh\ngit diff\n```\n\n## Add configuration to your App.jsx/tsx\n\n```typescript\n...\nimport Updates from '@rootpush/updates';\n...\n\nexport default function App() {\n  const key =\n    Platform.select({\n      ios: 'a69f3fa0-9109-44a2-8e2b-bb9e69f58f41',\n      android: '5a8607dd-b19e-4b01-b365-6b915fb3a326',\n    }) ?? '';\n  const branch = 'master';\n\n  React.useEffect(() =\u003e {\n    ReactNativeUpdates.sync(key, branch);\n  // useEffect will allow you to programmatically change the branch\n  }, [key, branch]);\n\n  return (\n    ...\n  )\n}\n```\n\nMore examples here: https://github.com/rootpush/updates/blob/main/example/src/App.tsx\n\n## Manual Installation Expo\n\n```sh\nnpm install @rootpush/updates @rootpush/updates-expo-plugin\n```\n\nAdd the plugin to your app.json or app.config.js:\n\n```json\n{\n  \"expo\": {\n    \"plugins\": [\n      \"@rootpush/updates-expo-plugin\"\n    ]\n  }\n}\n```\n\n## Manual Installation Bare Project\n\nInstall the updates package.\n\n```sh\nnpm install @rootpush/updates\n```\n\n### Android\n\nYou'll need to modify your main application file.\n\n**In your app:**\nLocated at `android/app/src/main/java/com/your-app-name/MainApplication.kt` (or .java if using Java)\n\n**Example implementation:**\nSee the [example implementation](example/android/app/src/main/java/rootpush/updates/example/MainApplication.kt) in our repo.\n\nAdd the following import and override the `getJSBundleFile()` method:\n\n1. Add the import at the top of the file:\n\n```kotlin\npackage ...\n\n+ import com.rootpush.updates.UpdatesPreferences\n```\n\n2. Add getJSBundleFile to the class:\n\n```kotlin\n+ override fun getJSBundleFile(): String {\n+     return UpdatesPreferences(this.application.applicationContext).getFullBundlePath()\n+ }\n```\n\n### iOS\n\nYou'll need to modify your app delegate file.\n\n**In your app:**\nLocated at `ios/YourAppName/AppDelegate.mm` (or .swift if using Swift)\n\n**Example implementation:**\nSee the [example implementation](example/ios/UpdatesExample/AppDelegate.mm) in our repo.\n\nMake the following changes:\n\n1. Add the import at the top of the file:\n\nObjective-C++\n```objectivec\n+ #import \"UpdatesPreferences.h\"\n```\nSwift\n```swift\n...\n+ import RootPushUpdates\n...\n```\n\n2. Replace the existing bundle URL code with:\n\nObjective-C++\n```objectivec\n#if DEBUG\n  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n#else\n+  UpdatesPreferences *preferences = [[UpdatesPreferences alloc] init];\n+  return [NSURL fileURLWithPath:[preferences getFullBundlePath]];\n#endif\n```\nSwift\n```swift\n#if DEBUG\n  return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: \"index\")\n#else\n+  let preferences = UpdatesPreferences()\n+  return URL(fileURLWithPath: preferences.getFullBundlePath())\n#endif\n```\n\n### Advanced Usage\n\nFor more control over the update process, you can use the individual methods:\n\n```javascript\nimport Updates from '@rootpush/updates';\n\n// Configure the update service\nUpdates.setConfiguration(\n  'YOUR_DEPLOYMENT_KEY',\n  'production', // or your branch name\n);\n\n// Check for updates\ntry {\n  await Updates.check();\n\n  // Check if update was downloaded and is ready to install\n  if (Updates.hasPendingUpdate()) {\n    // Install the update and reload the app\n    await Updates.install();\n  }\n} catch (error) {\n  console.error('Update process failed:', error);\n}\n```\n\n## Deploying Updates\n\nTo deploy updates to your app, use the `@rootpush/cli` tool. Here's how to get started:\n\nhttps://github.com/rootpush/cli?tab=readme-ov-file#usage\n\nThe CLI tool automatically detects your project type (Expo or bare React Native), branch, and target version, using the appropriate bundling commands for your setup.\n\n## API Reference\n\n### `setConfiguration(key: string, branch: string)`\n\nSets up the configuration for the update service.\n\n- `key`: Your deployment key\n- `branch`: The branch to use for updates (e.g., 'production', 'staging')\n\n### `check(): Promise\u003cvoid\u003e`\n\nChecks for available updates and downloads them if available.\n\n### `install(): Promise\u003cvoid\u003e`\n\nInstalls a previously downloaded update and reloads the app.\n\n### `rollback(): Promise\u003cvoid\u003e`\n\nRoll back to a previous bundle. The system does this automatically if issues occur after installation, or you can trigger it manually.\n\n### `hasPendingUpdate(): boolean`\n\nChecks if there is a pending update ready to install.\n\n### `sync(key: string, branch: string): Promise\u003cvoid\u003e`\n\nConvenience method that combines configuration, checking, and installation of updates. This method will:\n\n1. Set the configuration with the provided parameters\n2. Check for updates\n3. If an update is pending, install it\n\n## Development Mode\n\nAll update functions are automatically disabled in development mode (`__DEV__`). When in development mode:\n\n- `check()` will return immediately\n- `install()` will return immediately\n- `rollback()` will return immediately\n- Other functions like `hasPendingUpdate()` and `setConfiguration()` will still work normally\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootpush%2Fupdates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootpush%2Fupdates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootpush%2Fupdates/lists"}