I need to provide 30 days of trial period for my Flutter App, I am Using Hasura with Flutter. Example if User sign up on 1 april, after 30 days need to direct him to purchase page. How to achieve this in Flutter and Hasura? Can anyone guide?
1 Answers
This can be achieved in a couple of ways, depending on what level of permissions are required for the app.
- Recommended (via _exists permission check)
In the users
table of your app, have a boolean column called free_trial
. This flag will be true initially. In your permission check, you can make use of _exists
check to see if user is still in free trial or not. The condition will roughly look like
{"_exists":{"_table":{"name":"users","schema":"public"},"_where":{"free_trial":{"_eq":true}}}}
Now you need to update the free_trial column to false
once they cross 30 days. This can be done through a mutation that runs every day (as role admin) to check for signup date and updates the flag in the backend.
In the Flutter app, you can redirect users to payment page based on this flag. Once you have paid users, you can assign them different roles and different permission checks for the same.
- JWT claim based:
Create a role called “free_trial” and issue a JWT for it with access to specific APIs only. You can define permissions to allow and disallow certain operations in your app based on this role.

- 743
- 4
- 15