You can use the manifest.json file (also called the app manifest) to specify,
- App start-up parameters - such as the platform version used to build the app, the node version used, and so on.
- App’s functional parameters - such as the events that the app must respond to.
When you use the fdk create command, select the serverless-starter-template, and generate the serverless app files, the app manifest generated contains default attributes. To configure the app manifest for your app, you can modify the attribute values, delete (non-mandatory) attributes that your app does not require, or add appropriate attributes.
After creating the app files, to configure the app manifest, do one of the following:
- From the app’s root directory, navigate to manifest.json and manually configure the attributes. Or
- Use the fdk generate command to edit the default manifest.json.
App manifest attributes - description and how to configure them
- platform-versionstring
Platform version you use to build the app. This value is auto-generated when you create the default app files by using the fdk create command.
- modulesobjectRequired
Specifies all modules on which the app can be deployed.
When you create an app by using the fdk create command, the default app manifest is created with the common and support_ticket modules. You can edit the app manifest and replace the support_ticket module or add additional modules.Important:- The app manifest must contain at least one module (apart from the common module).
- Even if your app is built only for the common module, ensure that the modules object contains at least one module in addition to the common module. In this case, the other module(s) can be an empty JSON object. This other module’s name ties the app to the product on which the app is eventually deployed.
- commonobject
Specifies the common events that the app must respond to. Common events are events that are not specific to a module.
- eventsobjectRequired
Various common serverless events and the corresponding callback function/method names, specified in the following format:
"events": { "<eventName1>": { "handler": "<callbackFunctionName1>" }, "<eventName2>": { "handler": "<callbackFunctionName2>" } }
Subscribe to common events through event listeners: When you build a serverless app, replace the default values in this attribute with the events pertaining to your app. For app setup events, <eventName> is onAppInstall, onAppUninstall, or onAppUpdate. For external events, <eventName> is onExternalEvent. For scheduled events, <eventName> is onScheduledEvent.
Register callback: In <callbackFunctionName> enter the name of the callback method defined (or planned to be defined) in server.js. Ensure that for each event, only one callback is registered.Important:Common events are events independent of the product on which the app is deployed. So, ensure not to configure product events in common.events. Configure product events in the corresponding <module_name>.
- requestsobject
All configured request templates that the app code uses, for a product, in the following format.
Notes:"requests": { "<requestTemplateName>":{ "<option-name>": "<option-value>", "<option-name1>": "<option-value1>" … }, "<requestTemplateName1>": {} … }- <requestTemplateName> must be the same as that configured in config/requests.json.
- Possible values of <option-name> are maxAttempts, retryDelay, and oauth. If an option is specified in both manifest.json and config/requests.json, the option value specified in manifest.json takes precedence.
Important:In the default app manifest, created through the fdk create command, the requests object is not present. If your app code uses request templates, ensure to configure the requests object.
- <module-name>objectRequired
Contains the module-specific events that the app can respond to. The events must be compatible with the module identified by <module_name>.
In the default app manifest, created through the fdk create command, the <module-name> is support_ticket. You can edit the module name to replace it with the module where you want your app to be rendered. You can also add new modules, in addition to the support_ticket module.- eventsobjectRequired
Product events that the app must respond to and the corresponding callback function/method names, specified in the following format:
"events": { "<eventName1>": { "handler": "<callbackFunctionName1>" }, "<eventName2>": { "handler": "<callbackFunctionName2>" } }
Subscribe to product events through event listeners: When you build a serverless app, replace the default values in this attribute with the events pertaining to your app. <eventName> is the appropriate product event name. For a list of all compatible product events, see Module introduction.
Register callback: In <callbackFunctionName> enter the name of the callback method defined (or planned to be defined) in server.js. Ensure that for each event, only one callback is registered.
- scriptsobject
Contains the unit testing framework details.
- fdk-unit-teststring
Specifies the unit testing framework to be used when running tests for the app.
- enginesobjectRequired
Node.js and FDK versions that are used to build the app. When you create the front-end app files by using the fdk create command, this attribute value is auto-populated.
- nodestring
Node.js version on which the app is built.
- fdkstring
FDK version that is used to build, test, validate, and pack the app.
- dependenciesobject
All npm packages that the app uses, specified as <npm-package-name>:<version> pairs.
This attribute is not a default attribute. If your app uses npm packages, in manifest.json, include this dependencies attribute and register the packages as dependencies. - appobject
Information pertaining to the app metrics, auto-generated when the app is created.
Note:Currently, this object is auto-generated only when the app uses any Freddy Copilot features.
- trackingIdstring
Identifier for the app.
- startTimestring
Timestamp of when the app was created, specified in the UTC format.