aWhere Manual
Develop

App manifest

Every field of awhere-app.json, the file in which an App says what it is, what is required and what each field does.

An App manifest is the file in which an App says what it is: its name, who publishes it, where it is served, how it signs in and what it asks for. The file is called awhere-app.json. An App is installed from its manifest.

Installing an App does two things: it writes one row for the App, which keeps the manifest as it was installed, and it makes the App's OAuth client. Uninstalling takes both back, and installing again restores the same client with the same secret.

An App serves its own manifest at awhere-app.json under its address. When an administrator previews an install, the platform asks the App for that file and warns if it does not answer, if it is not readable, or if its id or version differs from the manifest being installed.

Only official manifests that are built into the platform's image can be installed today. A manifest with "channel": "community" is valid, but the platform refuses to install it until a site can show a person what an App asks for and enforce it.

An example

This is the manifest of Map Studio, as the App publishes it. It uses the required fields and a few optional ones.

{
  "manifestVersion": 1,
  "id": "map-studio",
  "name": "Map Studio",
  "shortName": "Map",
  "description": "Web maps with layers, styles and measurement.",
  "locales": {
    "th": { "description": "สร้างแผนที่เว็บที่มีชั้นข้อมูล รูปแบบการแสดงผล และเครื่องมือวัด" }
  },
  "publisher": {
    "name": "MAPBOSS Co., Ltd.",
    "url": "https://mapboss.co.th"
  },
  "channel": "official",
  "version": "1.0.0",
  "categories": ["maps"],
  "path": "/map-studio/",
  "oauth": {
    "scopes": ["*"]
  }
}

Required fields

A manifest without every field below is refused, and the reason names the field.

FieldValueMeaning
manifestVersionThe number 1The version of this file format. No other value is accepted.
idLowercase letters, digits and dashes, up to 64 charactersThe App id, the one name the App has. It is also the key of the install and the OAuth client the App signs in as. A community manifest may also use dots between its parts, for example acme.reports.
nameText, up to 60 charactersThe name the Marketplace shows.
version1.2.3, optionally followed by - or + and a suffix, for example 1.2.3-beta.1The version of the App.
channelofficial or communityWho made the App: official Apps are made by MAPBOSS, community Apps by anyone else.
publisher.nameTextWho publishes the App. See publisher.
path or urlSee Where the App is servedAt least one of the two.
oauth.scopesA list of text, which may be emptyWhat the App asks for. See oauth.

Optional fields

FieldValueMeaning
shortNameText, up to 12 charactersWhat the Launcher shows under the icon. When it is missing, the full name is used.
descriptionTextA short description of the App, shown in the Marketplace.
iconAn https address, a relative path, or an SVG data URI that starts with data:image/svg+xml;base64,The App's picture in the Marketplace. A relative path is resolved against the App's address when that address has a host, and anything else falls back to the platform logo.
categoriesA list of textGroups for the Marketplace's filter. admin, files, data, forms, maps and apps have their own words there; any other text is shown as written, with a capital first letter.
screenshotsA list of { "src": …, "caption": … }src is an https address or a relative path, caption is optional text.
homepageAn https addressThe App's web page.
supportAn https addressWhere to ask for help.
localesAn object keyed by language, see localesText in other languages.
requires.platformTextThe platform the App needs.

A key that is not in these two tables is dropped, and image is reserved and ignored. path and url are in the next section, and the keys inside publisher and oauth are in their own sections.

Where the App is served

path, url or both say where the App's address is. At least one is required.

FieldValueMeaning
pathStarts and ends with /, with no spaces, ?, #, . or .. parts, for example /map-studio/The App is on the platform's own host. Its address is the platform's address (PLATFORM_URL) followed by this path.
urlAn https addressThe App is somewhere else. When both are present, url wins.

An administrator can give a different address for one install, either an http or https address or a path that ends in /. That address is kept in the install and the manifest stays as it was.

publisher

FieldRequiredValue
publisher.nameYesText
publisher.urlNoAn https address
publisher.emailNoAn email address

oauth

The App signs in through the platform as an OAuth client whose id is the App id. The platform makes that client from the manifest, so a manifest cannot choose a different one: oauth.clientId is not allowed.

FieldRequiredValueMeaning
oauth.scopesYesA list of textWhat the App asks for. The Marketplace lists it under "What this app can do": * reads as acting as the signed-in person with that person's permissions, a scope it knows is described in words, and any other is shown as Access named "…". An empty list reads as asking for no access.
oauth.redirectPathsNoA list of relative pathsWhere the App's sign-in comes back to, under the App's address. When it is missing, the path is oauth/awhere-callback. Log Monitoring sets it to oauth-callback.
oauth.redirectUrisNoA list of https addressesFull addresses for a sign-in that comes back outside the App's address.
oauth.originsNoA list of https origins, such as https://reports.example.com, without a pathKept on the App's OAuth client as its origins.

redirectPaths become full addresses only when the App's address has a host. When the address is just a path, only redirectUris count. Official Apps ask for ["*"], and the platform does not enforce scopes for an official client.

locales

locales is an object whose keys are languages, such as th. Each value may contain only name, shortName and description, all as text, with shortName up to 12 characters. When the Marketplace is shown in a language that has an entry, those three texts replace the ones above. This is how every official App gives its Thai description.

"locales": {
  "th": { "description": "ตั้งค่าแพลตฟอร์ม รวมถึงบทบาท ผู้ใช้ กลุ่ม OAuth client และคีย์ API" }
}

What the platform does with each field today

  • The Launcher shows shortName (or name) and the App's picture. The picture is an uploaded logo of the App's client when there is one, and otherwise icon.svg under the App's address.
  • The Marketplace shows name, description, locales, publisher.name, version, channel, categories, icon and oauth.scopes, and filters by categories.
  • screenshots, homepage, support and requires.platform are checked and kept with the install, but no screen shows them and nothing compares requires.platform with the platform yet.

Official Apps

The nine official Apps each ship with a manifest that is built into the platform's image. Every official manifest is checked before it is built in, and one is refused whose manifestVersion is not 1, whose id is repeated or not made of lowercase letters, digits and dashes, whose channel is not official, whose path does not start and end with /, whose shortName is over 12 characters, or whose categories has anything other than maps, data, forms, apps, files or admin.

An official manifest does not carry its own icon. The platform takes the App's icon.svg and keeps it with the built-in manifest as an SVG data URI, and an icon written in the manifest is ignored.

On this page