Skip to content

Creating a new Smart App

mindofbeholder edited this page Sep 11, 2023 · 4 revisions

File Structure

New Smart Apps should be placed in a new folder within the Fenrus/Apps/Smart directory

At minimum you should have 3 files:

  • app.json
    • This file will contain metadata about your app such as the name and any values you need to intake (tokens/credentials)
  • icon.png
    • This is the default icon for your smart app
  • code.js
    • This file will contain the meat of your code where you make the api request, parse the data, and return it to fenrus for display

code.js

You'll create a new class for your app here. At minimum you must have a "status" method. This method is what is called by Fenrus to pull new data into the dashboard display.

You can optionally choose to include a "test" method which will be used to determine if the app's connection is successful. The expectation is to return true if everything is working, otherwise false or an error message.

Test Method

This method will need to return either a true for a successful test or a false for an unsuccessful test. If the test has failed, you can pass a string value into args.log() and that will be returned on the toast notification with a message that the test has failed.

Some tests that you can do include a request for a small amount of data, testing to see if you can successfully request an authentication token, or just that you get a 200 response from an endpoint.