Downloads / Releases
Use Moonbase to host secure downloads of your software releases
Written By Tobias Lønnerød Madsen
If you’re using Moonbase, you’re likely selling digital products of some kind, whether that’s actual applications with installers, or just .zip archives of files. And to actually deliver these files to customers, you use what we call “Releases”, found when configuring your products:

Releases are versioned, so that we can easily support update notifications for users of the application, but you can also maintain a single release where you update the files within.
When creating a new release, it will be in a pre-release state, where you need a direct link to be able to download any related files. For releases to be visible to your customers through customer portals, you need to Publish a release. You can at any time roll back to an earlier release if you need to withdraw a certain release from the customer portal.
Downloading releases
Your customers can access releases through a couple of different ways:
Direct links to downloads you have on your website
Through the customer portal, from products they own
For example, in the Moonbase Embedded Storefront, any user can access downloads from the product view:

It will highlight the best files to download based on the users platform, and provide direct access as long as it’s permitted by the security settings. The same features can be found in the hosted customer portal.
Limiting access
By default, access to files in a release requires ownership of the product. This is great for digital products where there is no DRM other than a secure download, but for products with licensing integrated, we suggest lowering the security settings. By clicking on “Actions” → “Configure security”, you are able to change the restrictions for downloading files:

By allowing open access to download, any customer can download installers directly from your website, and install immediately.
Static links to platform downloads
Some times you may want to directly link to downloads, especially if you have the security settings set to allow open access to download. To do this, you may link to some endpoints on our storefront API.
To download the latest version for a specific platform, you may use the following endpoint: http://<accountId>.moonbase.sh/api/customer/inventory/products/<productId>/download/<'mac'|'windows'|'linux'|'universal'>/latest. In case you have multiple files for the given platform, the endpoint will return the first file uploaded.
For example, the following link would download the latest Mac binary for the “Example Product” product on a demo account: https://demo.moonbase.sh/api/customer/inventory/products/example-product/download/mac/latest
Alternatively, you may also link directly to the hosted download page to offer UI for selecting which files to download, and support authentication in the process: https://demo.moonbase.sh/download/example-product