Publishing on Expo

Brent Vatne
Exposition
Published in
3 min readFeb 14, 2017

--

Update: The post below is out of date. An updated and improved version of this guide is now in our documentation under EAS Update.

One of the coolest features of Expo is that you can publish your projects to a permanent URL and share those URLs with other users. Here’s how it works.

Developing Locally & Background

While you’re developing your project, you’re writing code on your computer, and when you use XDE or exp, a server and the React Native packager run on your machine and bundle up all your source code and make it available from a URL. Your URL for a project you’re working on probably looks something like this:

exp://i3-kvb.ccheever.an-example.exp.direct:80

exp.direct is a domain we use for tunneling, so that even if you’re behind a VPN or firewall, any device on the Internet that has your URL should be able to access your project. This makes it much easier to open your project on your phone or send it someone else you’re collaborating with who isn’t on the same LAN.

But since the packager and server are running on your computer, if you close your laptop or close XDE, you won’t be able to load your project from that URL. So, we made a way to publish your project so that others can see it regardless of what you are doing on your computer.

How to Publish

To publish a project, just click the Publish button in XDE. (It’s in the upper right of the window.)

You’ll see a warning that this will make your project publicly accessible that looks like this:

If you don’t want anyone to be able to see your project, hit No! Otherwise, hit Yes.

When you do this, the packager will minify all your code and generate two versions of your code (one for iOS, one for Android) and then upload those to a CDN in the cloud. You’ll get a link like https://exp.host/@ccheever/an-example that anyone can load your project from.

Since the code is all on a CDN and minified, it will load quite quickly for anyone loading it from anywhere in the world.

Privacy

You can set the privacy of your project in your exp.json or app.json configuration file by setting the key “privacy” to either “public” or “unlisted” .

These options work similarly to the way they do on YouTube. Unlisted project URLs will be secret unless you tell people about them or share them. Public projects might be surfaced to other developers.

Standalone Apps

If you want to distribute your app to end users, you can create a standalone app and put it in the iOS App Store and the Google Play Store by building standalone apps.

A standalone app is basically a version of the Expo app that only opens the production URL for your project and has your name and icon.

When you publish new versions of your app, your standalone app will download the new version of the code

See the full guide to building a standalone app.

Updating Your Published Code

Updating your published code is really easy. Just click the Publish button again.

The new version of your code will be uploaded to the same URL. The next time someone opens your project from the Expo app, or from a standalone app as described above, they will get the new version of the code.

If you need to update the Expo SDK version of your app, your app icon, your app name, or build-time configuration that cannot be updated over the air, like your Google Maps API key, you will need re-build the standalone app.

--

--