# H5 Application

Feature Background

H5 Applications allow you to directly run web or game projects built for your business within the FinClip SDK in the form of a package.

# 1. Feature Overview

H5 Applications are similar to Mini-Program applications. They enable the migration and operation of existing projects without the need for transpilation or redevelopment as a Mini-Program.

Internally, H5 projects are provided with functionality and API interfaces by the Base Library. Their features are relatively consistent with those of Mini-Programs. In addition to including the Navigation Bar, Capsule Button, and the disabling of routing events, they also provide some of the APIs available in Mini-Programs for developers to use during development.

# 2. Instructions

Using the Mini-Program Management Console, when creating a new Mini-Program, select the type as "H5 Application". After creating a Mini-Program of the "H5 Application" type, you can write and debug its code using FinClip Studio.

Note: The Base Library used by the H5 Application is automatically included in the project during packaging. To use certain new features or newly added APIs, you need to repackage and upload the H5 project. When you need to update the Base Library to use new features, simply update to the latest version of Studio.

# 3. Project Configuration

# fide.project.config.json

Creating an H5 project will generate a fide.project.config.json file in the project root directory. In addition to some information fields used internally by the project, you can configure the following properties:

{
  "miniprogramRoot": "src", // Indicates the entry directory of the H5 project
  "entryFile": "main.html", // Indicates the entry file of the H5 project
  "queryParams": "a=1&b=2", // Parameters when launching the page
  "originUrl": "https://custom.com", // Loading domain, default is https://finoffline.com
}

The final entry file is: project directory${originUrl}/${miniprogramRoot}/${entryFile}?${queryParams}

If none are configured, the entry file is: project directory/index.html?${queryParams}

Note: originUrl currently only takes effect on Android and HarmonyOS.

# web.json

web.json supports the following fields:

# Configuration Items

Property Type Required Description
window Object No Global default window appearance

# window

Used to set the status bar, navigation bar, title, and window background color for the Mini-Program.

Property Type Default Value Description
navigationBarBackgroundColor HexColor #000000 Navigation bar background color, e.g., #000000
navigationBarTextStyle string white Navigation bar title color, only supports black / white
navigationBarTitleText string Navigation bar title text content
navigationStyle string default Navigation bar style, only supports the following values: 1. default (default style); 2. custom (custom navigation bar, only the top-right Capsule Button remains); 3. hide (hides the navigation bar and the top-right Capsule Button)
navigationBarHideCloseButton Boolean false Hide the Capsule close button
navigationBarHideMoreButton Boolean false Hide the Capsule menu button
fullscreen Boolean false Fullscreen display

# Configuration Example

{
  "window": {
    "navigationBarBackgroundColor": "#333",
    "navigationBarTextStyle": "white",
    "navigationBarTitleText": "H5 Application",
    "navigationStyle": "custom",
    "navigationBarHideCloseButton": false,
    "navigationBarHideMoreButton": true,
    "fullscreen": false
  }
}
© FinClip with ❤ , Since 2017