Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Can a Character Sheet Tell if the Game has Access to API

Basically, I'd like to add stuff to a char sheet that uses the API, but not have to also develop a separate one for those without Pro. So is there a way to check a session variable to see if the User (or Game Instance) is a pro user, then open up the scripts that user can access.
1593116291
Finderski
Plus
Sheet Author
Compendium Curator
Not that I've found, but you could provide a toggle/check-box so the person can manually indicate whether they have the API enabled. The Forbidden Lands character sheet supports both API-enabled and non-API-enabled accounts. That may be a place to start to see how they did it.
Excellent - thanks.  What happens if you try to call a script from a character sheet that is not enabled?  Do I need to error catch this?
1593119181
GiGs
Pro
Sheet Author
API Scripter
Nothing will happen. It wont cause an error, it'll just be silently ignored. So its a good idea to have a toggle to switch between API and non-API sheets, otherwise you'll have buttons that cause player confusion when they dont do anything.