FW Serverside Addons - Using Addons

In general, the main thing you need to do to use addons is to know how to set them up or update them. For more specific information on how to use the code of a specific addon, checking out that specific addon's documentation is your best bet.

Setting Up Addons

Navigate to your fw.json file and add your addon to the addon list. If you don't know what version to use, you can check on bitbucket, or in the addon documentation. An example addon list would be:

"dependencies": {
  "api": "^1.0.0-RC.1",
  "apps": {
      "gc": "1.4.11"
  },
  "addons": {
    "mail-core": "^0.6.3",
    "auth-core": "^0.4.0",
    "migration-core": "^0.5.2"
  }
}

After you have successfully updated and saved fw.json, navigate to your app's root directory and run fw install.

This properly installs the addon to your app, and for some apps you will be done. Other addons, however, require additional setup to make them work fully, so be sure to double check for any additional setup for the specific addon in the addon documentation.

Updating Addons

If you use the ^ in your addon version number, all you NEED to do is run fw install in your app's root directory, but to be extra safe, it is best to update the version number to the most recent version number in fw.json before running fw install (if you don't know what the most recent version is, you can search for the addon on Bitbucket, and check the downloads section of that repository to see the most recent downloadable version)

Important notes

There are a couple of additional things besides just setting up addons or updating them after they are installed.

Note about App Dependencies

Due to the way FW handles addons and app loading, if your app depends on another app and the two apps share a dependency, both apps will use the parent app's addon version. This means in order to update that addon in your app, the addon must first be updated in the parent app and that released. In these scenarios as well, make sure to increase the version of the app dependency needed in fw.json as well, so that you might not receive errors loading.

For a specific example, most apps depend on Group Control, which uses the common addon migration core. In order for an app to use a feature from a new version of migration core, the migration core version must first be updated in Group Control. Then, you would change your dependency requirement for "gc" in fw.json to be the version where GC updated the addon, at the following location:

"dependencies": {
    "api": "^1.1.1",
    "apps": {
      "gc": "^1.4.11"
    },
}

Fatal Error Loading

When an app is loading, if it does not have all the addon dependencies as required here, there will be a fatal error that a certain addon dependency is missing. If you receive this error it means that you did not properly install the addon to the app, and you should try the setup process again. If all else fails you can try deleting the addon from the apps-dir/apps/app-name/addons folder, and try to install again. If this doesn't work, double check that you did all the additional setup steps for your addon.