When you set up your app's pricing in the app dashboard, you can choose to provide users with a free trial. This is recommended especially if you don't provide a free version of your app, so you can let users experience your app's value before they decide whether to upgrade.
Once you choose to add a free trial, your app market listing will show how many days of free trial the app offers.
When providing a free trial, you should cover the experience of site builders who install your app and their site visitors - in all stages of the free trial. This means what happens during the trial, after the trial, for the entire app, or for specific features.
When the free trial is over, the app should behave as follows:
Your direct user is the site builder who installed your app. However, you should also think about the user of your user, the site visitor.
When the free trial is over, lock the app (or its premium features) from working. If it's a premium only app, we recommend to collapse (delete) it, so it's not seen on the site. If you cannot collapse it, present an indication, such as: "This app / feature is currently unavailable, contact the site owner for details". This is also true for Dashboard apps - collapse the app or present a proper message.
Here is a code example for collapsing the widget after the trial:
Currently, there is no out-of-the-box solution for tracking an app's free trial (however, there is an open feature request for it). So, each developer might choose to implement this differently.
To provide a free trial, you must save the instanceId (returned by the getDecodedAppinstance() Velo function), together with the installation date, in your own external database. This database can also hold information of who your users are, what are their website's URL, etc.
Your app's business logic should look something like the following. This is only a recommendation.
Note The same app on the same site will always have the same instanceId (even if it's deleted and installed again). This means that the site builder will not be able to do another free trial on the same site.