Modify this html template
https://github.com/justpy-org/justpy/blob/master/justpy/templates/optional_packages.html
to include your license in the script after the enterprise ag is loaded.
{%- if options.aggrid_enterprise %}
{%- if not options.no_internet %}
<script src="https://unpkg.com/ag-grid-enterprise/dist/ag-grid-enterprise.min.js"></script>
{%- else %}
<script src="/templates/local/ag-grid-enterprise.js"></script>
<script>
agGrid.LicenseManager.setLicenseKey("your licene key");
</script>
{%- endif %}
{%- endif %}
You can find the path to this file in your local environment by importing justpy or here