Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

How to build a Hive app

Jakub Suder edited this page Oct 18, 2013 · 32 revisions

Hive apps are made with HTML, CSS and JavaScript. They're basically just websites with JavaScript code, running in an embedded browser inside the Hive window. You can use most features you'd expect from a standard modern web browser.

App structure

A Hive app needs to have:

  • a manifest.json file at the root of the project tree
  • an index.html file, in the same place
  • an icon file

It can also contain additional helper files like scripts, stylesheets and images, which you can place anywhere inside the app directory.

Manifest file

The manifest file includes various metadata about the application. It should contain a single JSON hash that looks like this:

{
  "id": "com.grabhive.awesomeapp",
  "version": "1.0",
  "name": "My Awesome App",
  "author": "Me",
  "contact": "me@google.com",
  "description": "Just run it and see",
  "icon": "icon.png"
}

List of fields that can be included in the JSON:

  • id: string (required) - a string that uniquely identifies the app; there can't be two apps with the same ID, so domain-style IDs like "com.company.product" are recommended
  • version: string (required) - current version of the app - in future we'll have some kind of auto-update feature in Hive that will check app repositories and download new versions if the current version is lower than the one in the repo
  • name: string (required) - this will be shown on the "Apps" screen below the icon, make sure it isn't too long
  • author: string (required) - your name
  • contact: string (required) - your email address
  • description: string (required) - currently unused, but we're planning to use it later; make it 1-2 sentences long
  • icon: string (required) - name of the file storing the icon to be shown on the "Apps" screen
  • homepage: string (optional) - currently unused, but if you set it we might use it later
  • charity: boolean (optional) - currently unused, but if you're creating an app that lets people donate Bitcoin to a charity, set this to true; this will tell us that we shouldn't deduct transaction fees from transactions made from this app in the future
  • tor: string (optional) - currently unused, but we plan to use this value in the future to determine if this app should use Tor connections; set this to "allow", "require" or "disable" (default is "allow")

Index file

The index.html file is the entry point to your app. It should render the app's main view, load necessary scripts and stylesheets, and so on. Remember that the Hive window has proportions and dimensions similar to a mobile phone screen, so you should design this page like a mobile website. Don't assume any specific dimensions - be prepared for page width between approximately 275px and 500px and height from 400px to 800px or more.

JavaScript API

To access user's data and prompt the user to send Bitcoin to a given address, we should use our JavaScript API - check out our API specification.

Bundling the app

To load the app into Hive, user needs to download your app files bundled inside a zip archive with the extension changed to .hiveapp, and then double-click the bundle and confirm the action in Hive. When you're ready to release a new version of the app, pack the application inside an archive, rename it and upload it somewhere, e.g. to the "Releases" page in your GitHub repository. We're planning to have a central repository linking all apps to a single place (watch this ticket), but for now users will have to download and install it manually.

Clone this wiki locally