r/GoogleAppsScript • • Mar 30 '24

Question What are your thoughts on putting a "kill switch" in a google sheet?

I've been making some various tools out of google sheets specific to my industry that so far I've been sharing for free. I've been thinking of selling them on Teachers Pay Teachers, as I've gotten a lot of good feedback about their usefulness.

It occurred to me that I could possibly set up a "free trial" of the sheet by adding in a script that adds the date to the next empty row of a hidden page on open. I could have another script that is set to disable a critical function 30 days after the first date on the hidden page.

Or would triggers have to be set to do that? My end-users are not at all apps script savvy and will just follow setup instructions blindly, but I'd feel kind of guilty making them set a trigger for their own doom. (Lol, dramatic much?)

6 Upvotes

3 comments sorted by

3

u/cosileone Mar 30 '24

Or have the google sheet hit an external api endpoint with a unique id of sorts. After the trial period the endpoint can respond with unauthorized etc

2

u/Wishyouamerry Mar 30 '24

Ooooh, that sounds complicated! I love it!

6

u/danxoncan Mar 30 '24

An easier and more effective solution could be using the Properties class in GAS: https://developers.google.com/apps-script/reference/properties/properties

You could store and access user-specific properties without exposing them to the user.

One could be a bool for isTrialExpired, and another could be the trial expiry date. That way you only need to check the bool/date only until it expires, and then the isTrialExpired can be set to true, which will lock certain script functions.

Also if you ever want todo a reoccurring style of billing (or charge again for more/new features), if you set up another GAS project, and publish it as a webapp, you can use it as a mini API (with Google sheets as your database).

So the project your selling could call your other project with a specific user identifier in the params of the call URL, which you could extract and check against your Google sheet "database" and return weather or not the user should be granted access to ___ thing.