---
title: "Using JWT as a license key in Google Apps Script Google Workspace Add-ons"
author: "Martin Hawksey"
date: 2022-12-08T20:32:59+00:00
canonical_url: https://pulse.appsscript.info/p/2022/12/using-jwt-as-a-license-key-in-google-apps-script-google-workspace-add-ons/
markdown_url: https://pulse.appsscript.info/p/2022/12/using-jwt-as-a-license-key-in-google-apps-script-google-workspace-add-ons.md
categories:
  - "Add-on"
  - "Intermediate"
  - "Solutions"
  - "V8"
tags:
  - "@zzappsnl"
  - "zzapps.nl"
featured_image: https://pulse.appsscript.info/files/2022/12/jwt-token.png
description: "Here's an elegant solution from Riël Notermans (Zzapps) for letting users unlock premium functionality in your Workspace Add-on without relying on an external fetch or database by using an encrypted JWT web token. You can include various data in the token and this example a subscription email and expiry is included which can be checked locally, for example, comparing the email from Session.getActiveUser().getEmail()."
---

# Using JWT as a license key in Google Apps Script Google Workspace Add-ons

![Using JWT as a license key in Google Apps Script Google Workspace Add-ons](https://pulse.appsscript.info/files/2022/12/jwt-token.png)

> Image credit: Zzapps
> Many developers want to offer specific, additional functionality for specific users. One very common scenario is to differenciate in users that pay for this functionality.
> When you deliver an add-on, you want to know whether this user has this special access. We know this as a license.
> In this blog, I will show you how we can let the add-on know what the user’s license is. We are going to do this by giving the user a key, where they can ‘unlock’ functionality by pasting this in their add-on.

Here’s an elegant solution from Riël Notermans (Zzapps) for letting users unlock premium functionality in your Workspace Add-on without relying on an external fetch or database by using an encrypted JWT web token.

You can include various data in the token and this example a subscription email and expiry is included which can be checked locally, for example, comparing the email from `Session.getActiveUser().getEmail()`.

Source: *[Use JWT as a license key in Google Apps Script add-ons*](https://www.zzapps.nl/blog/jwt-license)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2022/12/using-jwt-as-a-license-key-in-google-apps-script-google-workspace-add-ons/](https://pulse.appsscript.info/p/2022/12/using-jwt-as-a-license-key-in-google-apps-script-google-workspace-add-ons/)*
