How to create a LifeTime Plugin
Plugins are special applications that are seamlessly integrated into LifeTime:
If you want to create a LifeTime plugin, do the following:
-
Access LifeTimeSDK by typing 'LifeTimeSDK' in the URL of your LifeTime environment.
-
Follow the 'click here' link at the end of the page.
-
Choose your LifeTime plugin development environment
-
Install LifeTime SDK on the environment. If you have a LifeTime already installed in that environment, the LifeTime SDK installation will fail. In this case, you must remove LifeTime from the environment before proceeding with LifeTime SDK installation, which involves deleting LifeTime's applications. Note: If you disable LifeTime's applications without deleting them, you won't be able to install LifeTime SDK.
-
Take this opportunity to also export sample data to your plugin development environment. This is important because all the data provided by the APIs is located in LifeTime's server, so if you call any API action from a Development server, those calls won't return any data unless, of course, you have exported it to that environment.
-
Now you can start the coding part. It can be done in two different ways:
- By clicking on the Start developing you plugin now link:
- By creating a new application in Service Studio while connected to the environment where the SDK was installed. A new template for LifeTime plugins should now be present:
This template already has:
- The bootstrap action to register the plugin in LifeTime
- The webservice to configure if the plugin is visible to the current LifeTime user
- A UI template and styles to make your plugins look like part of LifeTime
- All the APIs ready to use!
-
Check the sample plugin. In the forge a sample plugin called Geo Performance gives you an idea of how to create a simple plugin that uses all the APIs. It's also an example of how we built some parts of Performance Monitor, including the data aggregation process.
-
Plug it. Since the plugin was developed in a separate environment from LifeTime you need to integrate it once you finish developing and testing it. For that, simply grab the solution and publish it in LifeTime environment's Service Center.