--- title: "Create a New Function and NAF App" slug: "create-a-new-function-and-naf-app" description: "Learn how to create a Narmi Function in Narmi Command, register a NAF App, update template code, and test it in Online Banking." tags: ["Online Banking"] status: "new" updated: 2026-12-01T17:11:29Z published: 2026-12-01T17:11:29Z canonical: "help.narmi.com/create-a-new-function-and-naf-app" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.narmi.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a New Function and NAF App From Narmi Command, you can create a Narmi Function using one of our pre-built templates or start from a custom code zip archive. If you are using a custom code archive, refer to the [Technical Limitations](/apihome/apidocs/technical-limitations) to ensure your project meets the requirements. VPN Connection If you are planning to connect to your banking core from the function and your institution uses a VPN to connect to the core, you must enable core connectivity with additional settings. Go to [VPN Connectivity](/apihome/apidocs/vpn-connectivity) for instructions. We recommend starting with one of the Hello World templates in order to get familiar with how Narmi Functions works. For these instructions, we’ll use the **Hello World Hosted NAF** template and create a simple [NAF App](https://help.narmi.com/docs/naf-apps) to display text within Online Banking. This process involves creating a new function, registering a NAF app, updating the template code, and testing your app. *Note: Please see these [staff permissions](/apihome/apidocs/narmi-functions#narmi-function-staff-permissions) required to create and manage Narmi Functions.* ## Create a New Function To create a new function from a template: 1. From Narmi Command, select **Extensions** > **Narmi Functions**, then select **Add function**. ![NF1market](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF1market.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=fHkp7Wh7JUPCo6rJ4gwN5FFjGZ%2F%2Bd3OwkvmzCbWuVVU%3D) 2. On the page that appears, select **Start from a template**. ![NF2](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF2.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=ZW8SPtrjfnVcoruB33Tcr22GLmGxjddQHGWnEhhFA9Q%3D) 3. Enter the **Function name** and **Description**. The function name is the title that will display in the Narmi Functions list and the description will display in the function details page. Enter a simple description that users will understand at a glance. ![NF3](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF3.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=NZYSXS8Qs8XbpW8R9dwcHdGoy3T6R%2FcKxJgzE1OHMu4%3D) 4. Below the Description are several templates to choose from. For full details on each available template, go to [Built-in Templates](/apihome/apidocs/built-in-templates). For this example, select the **Hello World hosted NAF** template. If you would like to look through the function code to understand it more before deploying, select **Download code**. ![imagedev](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/image-ZZ2C7PVP.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=z0woLkrt2ezIi%2BWbZcBXl5Z5oLfdk%2BGthEk6htQOBlY%3D) 5. Select the function type, which will determine how the function can be invoked and is dependent on the use case the function is meant to fulfill. ![NF5](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF5.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=4KLi9pnEiGZ32SxKFEUZZ%2BvL%2BwiKwVUyeJrzql8mUz0%3D) There are three supported function types: - **Webhook**– A webhook for a specific user event, or “trigger event,” is created, and the function will be invoked via that webhook each time the trigger event occurs. Depending on the type of event, the request body will include `resource_id`, `user_id`, or `additional_id`. - For a list of valid trigger events to enter, go to [User History Actions](https://help.narmi.com/docs/user-history-actions). - For more information on webhooks, go to our [webhooks documentation](https://help.narmi.com/apidocs/webhooks-1). - **Schedule** – The function is executed on a regular schedule and requires a CRON expression to describe individual details of the schedule. Go to [CRON expressions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions) for an explanation of CRON fields and characters. - **Narmi Application Framework**– This function is invoked via its URL, either by a user visiting it through the NAF App (which adds it to the Online Banking product), or via an API request. The request here contains a **token**, which can be decrypted using the NAF App’s Client Secret to validate the legitimacy of each request. Select the request method your NAF Application will be using. For this example, select the **Narmi Application Framework** type and **GET** as the request method for the NAF App. 6. If needed for your function, select the environment variables. These can be added as key-value pairs and will be added to your function’s runtime environment. All environment variables are encrypted at rest. Checking the **encrypted** option for an environment variable also guarantees it will be encrypted in transit using an AWS KMS encryption key (all environment variables use TLS in transit regardless), but also will require an additional API call to be made in your function to decrypt the variable. This option must be selected for any secrets. Additional information for variable decryption is available with the decrypt template. No environment variables are required for this example using the Hello World hosted NAF function. 7. Select **Upload** to create your function. The function State displays “Creating.” ![NF6](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF6.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=BamFFLjb9hCAxUQG5nkSXwNQJHZ0Q6K0subzYndHvrE%3D) It takes approximately 30 seconds for the function to be created and all resources to be provisioned. Refresh the page to see the latest status. Once the function is created, the State updates to “Active.” ![NF7](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF7.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=TJhuwB2S%2BSerWTqwrREyMCKZJDMgxcWUkBo%2BqExtioU%3D) 8. Once the function is active, copy the **Frontend URL**, which will be used for the Redirect URL when you [register a NAF App](/apihome/apidocs/create-a-new-function-and-naf-app#register-a-naf-app) in step 2 of the next section. ![NF8](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF8.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=gEhItgP%2FonsS%2Fz5aT5eeOOUYFjhUqsUwvBZlK7vAoDk%3D) Optionally, at the top of this page, select the **Code** tab to view or manually edit the backend code, or select the **Monitor** tab to view backend function metrics or download logs. Go to [Maintain and Monitor Functions](/apihome/apidocs/maintain-and-monitor-functions) to learn more about the actions on this page. You can also test your Narmi Function by sending a test event. From the **Actions** sidebar, select **Submit a test event**. ![NF9](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF9.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=2mYutH6Zi57e5KL8dUCKyb8GuuRBGpYQj9XTa3imDF4%3D) 9. In the panel that opens, select **Submit test event**. The **Result** box displays the resulting output. ![NF10](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF10.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=WoekIMHEXV%2BQE7tASc6xE3duM9GrssFRbBC2lAeU3RE%3D) ## Register a NAF App 1. For some integrations, like this example, you’ll need to register a NAF App. Stay in Narmi Command and select **Extensions** > **NAF Apps**, then select **Register new app**. ![Image](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/image-PHZZAR07.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=uZ%2BQTkllO5BGjencSxX8HAT%2BDEJZtuSFmJTzBgL2GIs%3D) 2. On the page that appears, enter the function's Frontend URL you copied into the **Redirect URL** field. For user-facing apps like this example, select **Yes** for **Should the app be public and visible to users?** Additionally, select **New tab (GET)** so the application opens in a new tab in Online Banking. ![NF12](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF12.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=7OBPWeaa2nqBY6YuTKpXTj8%2F8eRklDKxHbsEKvCT%2F8E%3D) 3. Select **Register app**. The Client Secret will appear onscreen once you complete registration of the NAF App. Some integrations require the Client Secret, so copy that secret to enter in the function’s environment variables, if needed. ![NF13](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF13.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=qIBXPED1fdlFnn5FOMU8nno7pNjgJPMe%2F6RqXXM2WCY%3D) For complete instructions on NAF Apps, go to [Register a New NAF App](https://help.narmi.com/docs/register-a-new-naf-app). Your registered NAF App displays in the NAF Apps list, where you can copy the Client ID, if needed for your integration. To create an access token, select **Manage Tokens** > **Add new token**. ![NF14](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF14.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=MJ2e5xm1TYB6GVUl%2FxCxDHKdIDoVi1uNyZL3JICtlCQ%3D) ## Update Template Code with Backend URL Next, you’ll need to update your template code with the Narmi Function Backend URL so that the frontend static website sends requests to the correct backend. 1. Go back to Narmi Command and under **Narmi Functions**, select your function. 2. Copy the Backend URL (you will paste this in step 5). ![NF15](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF15.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=HJnHHnFhCOxNq%2BqxN7HYO6OP95mYCbij2tsrOcE2QAA%3D) 3. Under **Actions**, select **Download Code** > **Download frontend code**. ![NF16](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF16.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=ayvKYxBSXvGz5jukb1Orj40RiRjqbVTQhBBPtFci8jY%3D) 4. Unzip the downloaded function code and open the index.js file. 5. Paste the Backend URL into the function code and save. ![NF17](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF17.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=kMWioMSxHJ37342ggLd9yVhakMnASVOumqAvjVFDG%2B0%3D) 6. Zip the updated files so you can upload them in the next step. *Note: In order for the zip file to upload properly, you must use the zip command line command found on all major operating systems.* 7. Back in your function, under **Actions**, select **Update function configuration**. ![NF18](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF18.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=IRNac6nEMNRj3%2Fqs4Nge46x63%2BVNHxxNPvZTOaBRfcI%3D) 8. Under **Select a zip file to be deployed as a static website**, choose **Select File**. ![NF21](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF21.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=9Yho7i6mJcIYqTJc3hAgz7mtiifze%2B6tyqZxrosMzRU%3D) 9. Select **Upload**. After about 30 seconds, refresh. Once you see the “Active” state, your function is ready to test. ![NF19](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF19.png?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=If8rPLyKlqwoLn1vcsV7H3DK23QILsS5p9HXmY2gwkM%3D) ## Test Your App To test your app, log in to online banking as a user. Select **Tools** on the top navigation bar, and then select your NAF App name. ![NF20](https://cdn.document360.io/3f0bd847-05b9-4e98-b884-31d0303a85ba/Images/Documentation/NF20.gif?sv=2026-02-06&spr=https&st=2026-12-03T23%3A57%3A21Z&se=2026-12-04T00%3A57%3A21Z&sr=b&sp=r&sig=QUxsBv9nFsCoavoOJC3r2tUbOlfh19EbEZgSsIl8W1Q%3D) ## Related - [Built-in Templates](/built-in-templates.md) - [Narmi Functions](/narmi-functions.md)