Expo does not store your application's source code in its cloud services. Expo CLI and Expo Application Services (EAS) are build tools that require you to provide the source code from your local machine or a remote repository like GitHub. The source code remains under your control, stored entirely on your own machines or version control systems, ensuring that Expo never has access to your proprietary logic or assets.
Understanding Expo’s Role in the Development Lifecycle
It is crucial to distinguish between the development environment and the build infrastructure. When you use
expo-cli locally, all operations happen on your computer. The Expo server may be contacted for certain updates or prebuild configurations, but it does not receive your actual JavaScript, TypeScript, or native code files. Similarly, when you use EAS Build, you are uploading a "source bundle" or building directly from a Git repository. In both scenarios, the raw source code stays with you.
The confusion often arises because Expo manages the *build artifacts*—the compiled Android APKs, iOS IPA files, or web bundles. These artifacts are stored temporarily on Expo’s servers so you can download them after a build completes. However, these are compiled outputs, not editable source code. You cannot decompile an Expo-managed build to retrieve your original source code if you lose it, which further proves that Expo does not hold a copy of your source.
The Importance of Version Control Systems
Since Expo does not back up your source code, relying on local storage alone is risky. If your hard drive fails, your project is lost. This is why integrating with a version control system like GitHub is mandatory for professional development. By pushing your code to GitHub, you create a remote backup that is independent of Expo’s infrastructure.
When you initialize a new Expo project, it typically comes with a
.gitignore file that excludes node_modules and other generated files. You should commit your core source files, including
App.js, configuration files, and assets, to your repository immediately. This ensures that even if you switch computers or reinstall your operating system, you can clone the repository and rebuild your app using EAS without any data loss.
For teams working on complex projects, managing dependencies and checksums can sometimes lead to issues during automated processes. Understanding how to maintain integrity in your build pipeline is essential. For more details on handling file integrity in automation, you might find this article helpful:
GitHub Action: Why is appending checksum after each step to checksums.txt overwriting the file each time?
EAS Build and Source Retrieval
EAS Build operates by pulling code from your Git repository or accepting a source bundle upload. It does not cache your entire source tree indefinitely. Once the build is finished and the artifact is downloaded, Expo removes the temporary build environment. There is no "recovery" feature for source code within the Expo dashboard because it was never stored there in the first place.
If you need to retrieve code for debugging purposes after a build, you must refer to your Git history. You can checkout specific commits to see exactly what code was included in a particular build. This practice also helps in auditing changes and rolling back to previous versions if a new update introduces bugs.
Some developers worry about security, wondering if Expo employees can access their code. Since the code is processed in isolated containers during the build phase and then destroyed, the risk of persistent exposure is minimal. However, best practices dictate that you should never include sensitive credentials or private keys in your public repositories. Use environment variables and secret management tools instead.
Best Practices for Code Safety
To ensure your source code is always retrievable, follow these steps:
- Initialize Git Early: Run
git init as soon as you create your Expo project.
- Commit Regularly: Make small, frequent commits to track changes effectively.
- Push to Remote: Connect your local repository to GitHub, GitLab, or Bitbucket.
- Use Branches: Create feature branches for new developments to keep main stable.
- Backup Assets: Ensure large media files are managed properly, possibly using external CDNs if they are too large for Git.
By adhering to these practices, you maintain full ownership and control over your intellectual property. Expo serves only as a toolchain facilitator, not a storage provider.
Conclusion
Expo does not store your source code, and it cannot be retrieved from Expo servers because it was never uploaded in a permanent form. Your source code lives in your local directory and your remote Git repository. Always rely on version control for safety and retrieval. If you ever face issues with accessing URLs or viewing source code in a browser context, such troubleshooting techniques can be useful for debugging frontend components. See this guide for related troubleshooting:
Troubleshooting: Unable to Open Webpage in New Window or Access URL or View Source Code.
Frequently Asked Questions
Can I recover deleted source code from Expo?
No, you cannot recover deleted source code from Expo because it never stored it. If you delete files locally and do not have a Git backup, the code is permanently lost. Always maintain a remote repository to prevent such data loss.
Does EAS Build save my code after the build finishes?
EAS Build does not save your source code after the build process is complete. It uses the code temporarily to generate the binary artifact and then discards the build environment. You must manage your code backups independently through Git or other version control systems.
Is my source code visible to Expo developers?
Your source code is processed in isolated, secure containers during the build phase. While the system needs access to compile your app, Expo does not provide manual access to user source code, and it is not stored persistently where developers could browse it.
What happens if my GitHub account is deleted?
If your GitHub account is deleted, you lose your remote backup unless you have cloned the repository locally or pushed to another remote. It is advisable to mirror your repository to multiple platforms or keep a local backup to mitigate this risk.
Can I export my source code from an Expo Go app?
You cannot extract source code from an Expo Go app running on a device. Expo Go is a client that runs JavaScript bundles, but it does not expose the underlying source files. You must have the original project files to modify or view the code.