UNPKG

@cloud-push/expo

Version:

[![@cloud-push/cloud](https://img.shields.io/badge/@cloud--push/cloud-v1.1.1-blue)](https://www.npmjs.com/package/@cloud-push/cloud) [![@cloud-push/expo](https://img.shields.io/badge/@cloud--push/expo-v1.1.1-blue)](https://www.npmjs.com/package/@cloud-p

165 lines (127 loc) โ€ข 5.26 kB
[![@cloud-push/cloud](https://img.shields.io/badge/@cloud--push/cloud-v1.1.1-blue)](https://www.npmjs.com/package/@cloud-push/cloud) [![@cloud-push/expo](https://img.shields.io/badge/@cloud--push/expo-v1.1.1-blue)](https://www.npmjs.com/package/@cloud-push/expo) [![@cloud-push/next](https://img.shields.io/badge/@cloud--push/next-v1.1.1-blue)](https://www.npmjs.com/package/@cloud-push/next) [![@cloud-push/cli](https://img.shields.io/badge/@cloud--push/cli-v1.1.1-blue)](https://www.npmjs.com/package/@cloud-push/expo) [![@cloud-push/utils](https://img.shields.io/badge/@cloud--push/utils-v1.1.1-blue)](https://www.npmjs.com/package/@cloud-push/next) ## **Typescript Only, Zero kotlin, Zero Swift, Zero java, Zero Object-C** **OTA Update solution compatible with Expo Updates** โ†’ Self-hosted update distribution system ## ๐Ÿ“š Documentation You can find the full usage guide and API reference in the ๐Ÿ‘‰ [**Cloud Push Docs**](https://doyoonkim12345.github.io/cloud-push/) ## ๐Ÿš€ Motivation Expo projects are highly customized React Native projects. Because of this, available CodePush solutions are limited. This project, inspired by [`hot-updater`](https://github.com/gronxb/hot-updater), offers an alternative way to manage bundles using storage services like S3, Firebase, Supabase, etc. It follows [Expo Updates technical specs](https://docs.expo.dev/technical-specs/expo-updates-1/) and maintains compatibility with Expo Updates. ## ๐Ÿงช Compatibility - โœ… Works with `expo run:android --variant release` - โœ… Works with `expo run:ios --configuration Release` - โœ… Compatible with **Expo Managed Workflow** ## โœจ Key Features - ๐Ÿ“ก Self-hosted deployment supported - ๐Ÿ“ฆ Flexible storage & DB (S3, Supabase, Firebase, etc.) - ๐Ÿ”„ Compatible with Expo Updates APIs - ๐Ÿ’พ Web-based bundle version dashboard - ๐ŸŒ Supports expo.dev environment variables (via EAS Secrets) - ๐ŸชŸ Works on Windows - ๐Ÿงช EAS build supported ## ๐Ÿ›  Configuration Examples ### Supabase ```ts import { defineConfig } from "@cloud-push/cli"; import { SupabaseStorageClient, SupabaseDbClient } from "@cloud-push/cloud"; export default defineConfig(() => ({ loadClients: () => { const storageClient = new SupabaseStorageClient({ bucketName: process.env.SUPABASE_BUCKET_NAME!, supabaseUrl: process.env.SUPABASE_URL!, supabaseKey: process.env.SUPABASE_KEY!, }); const dbClient = new SupabaseDbClient({ tableName: process.env.SUPABASE_TABLE_NAME!, supabaseUrl: process.env.SUPABASE_URL!, supabaseKey: process.env.SUPABASE_KEY!, }); return { storage: storageClient, db: dbClient, }; }, })); ``` ### AWS S3 + lowdb ```ts import { defineConfig } from "@cloud-push/cli"; import { AWSS3StorageClient, LowDbClient } from "@cloud-push/cloud"; export default defineConfig(() => ({ loadClients: () => { const storageClient = new AWSS3StorageClient({ accessKeyId: process.env.AWS_ACCESS_KEY_ID!, bucketName: process.env.AWS_BUCKET_NAME!, region: process.env.AWS_REGION!, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!, }); const dbClient = new LowDbClient({ downloadJSONFile: () => storageClient.getFile({ key: "cursor.json" }), uploadJSONFile: (file: Uint8Array) => storageClient.uploadFile({ key: "cursor.json", file }), }); return { storage: storageClient, db: dbClient, }; }, })); ``` ### Firebase ```ts import { defineConfig } from "@cloud-push/cli"; import { FirebaseStorageClient, FirebaseDbClient } from "@cloud-push/cloud"; export default defineConfig(() => ({ loadClients: () => { const storageClient = new FirebaseStorageClient({ credential: process.env.FIREBASE_CREDENTIAL!, bucketName: process.env.BUCKET_NAME!, }); const dbClient = new FirebaseDbClient({ credential: process.env.FIREBASE_CREDENTIAL!, databaseId: process.env.FIREBASE_DATABASE_ID!, }); return { storage: storageClient, db: dbClient, }; }, })); ``` ## ๐Ÿ“˜ Expo Updates SDK Compatibility ### ๐Ÿงฑ Constants | Constant | Supported | |------------------------------|-----------| | `Updates.channel` | โœ… | | `Updates.checkAutomatically` | โœ… | | `Updates.createdAt` | โœ… | | `Updates.emergencyLaunchReason` | โณ | | `Updates.isEmbeddedLaunch` | โœ… | | `Updates.isEmergencyLaunch` | โณ | | `Updates.isEnabled` | โœ… | | `Updates.latestContext` | โœ… | | `Updates.launchDuration` | โœ… | | `Updates.manifest` | โœ… | | `Updates.runtimeVersion` | โœ… | | `Updates.updateId` | โœ… | ### ๐Ÿงฉ Hooks | Hook | Supported | |----------------|-----------| | `useUpdates()` | โœ… | ### ๐Ÿ›  Methods | Method | Supported | |-------------------------|-----------| | `checkForUpdateAsync()` | โœ… | | `clearLogEntriesAsync()`| โœ… | | `fetchUpdateAsync()` | โœ… | | `getExtraParamsAsync()` | โŒ | | `readLogEntriesAsync()` | โœ… | | `reloadAsync()` | โœ… | | `setExtraParamAsync()` | โŒ | ---