The function
module is where the app's behavior is defined. Other modules specify the function module
that defines the actions to take.
Property | Type | Required | Description |
---|---|---|---|
key | string | Yes | A key for the module, which other modules can refer to. Must be unique within the manifest and have a maximum of 23 characters. Regex: |
handler | string | Yes | A pointer to the function responsible for handling invocations. Expected format: For example, Regex: |
providers | Providers | A list of the providers required by the function. | |
timeoutSeconds | integer | No | The maximum timeout, specified in seconds. This applies only to the scheduled triggers module and the consumer of an asynchronous event. If this parameter is set for a function used by multiple modules, the function timeout will be the lowest timeout value among all modules. This parameter does not affect functions that are not used as asynchronous event consumers or scheduled triggers. Valid range: 1 and 900 seconds Example: If you have a function used by both a scheduled trigger (timeoutSeconds: 300 seconds) and an async event consumer (timeoutSeconds: 120 seconds), the function will timeout after 120 seconds, because that’s the lowest value. |
runtime | Runtime | No | Override Forge runtime configuration defined in app.runtime . For now, only memoryMB property is allowed. |
1 2modules: function: - key: main handler: index.run runtime: memoryMB: 1024
1 2export interface ProviderReference { provider: string; requiredScopes?: string[]; }
Property | Type | Required | Description |
---|---|---|---|
auth | List<ProviderReference|string> | Yes | A list of keys or objects referencing authentication providers. Using |
1 2function: - key: google-macro handler: index.google_macro providers: auth: - provider: google requiredScopes: - "https://www.googleapis.com/auth/userinfo.profile" - "https://www.googleapis.com/auth/userinfo.email" - key: dropbox-macro handler: index.dropbox_macro providers: auth: - dropbox
Rate this page: