documentationfor yFiles for HTML 2.6

Licensing

This chapter explains the license mechanism of yFiles for HTML. It describes

  • the steps to successfully include a valid license into a yFiles for HTML-based application,
  • the different license types, and
  • how to resolve license errors.

See the section Redistributables to learn about the Redistributables of yFiles for HTML.

General Concept

In order to run, a yFiles for HTML-based application needs a valid license that contains information about:

  • the domains from which the application can be served
  • the yFiles for HTML versions for which a license is valid
  • the type of the license
  • data about the licensee

The following example shows a (non-functional single developer) development license:

What license data looks like
{
  "company": "yWorks GmbH",
  "date": "05/08/2020",
  "developer": "Joe Average",
  "distribution": false,
  "domains": [ "*" ],
  "fileSystemAllowed": true,
  "licensefileversion": "1.1",
  "localhost": true,
  "oobAllowed": true,
  "package": "complete",
  "product": "yFiles for HTML",
  "type": "singledeveloper",
  "version": "2.0",
  "watermark": "yFiles for HTML Development License",
  "key": "90b9a98e11c9923878b2c6403ac60efc60fbacdc"
}

Registering the License

Although yFiles for HTML licenses are usually conveyed as separate files, and the demos and tutorials load the license data from a separate license file (license.json), it is not necessary to use a separate license file in your yFiles for HTML application. Instead, the license data can just as well be included in one of your source code files.

Regardless of whether you use the JS Modules or the AMD of modules the yFiles for HTML library, add the license data to the value property of the License object before calling any other yFiles for HTML API.

Registering the license data with ES modules
import { License } from 'yfiles';

License.value = {
  company: 'yWorks GmbH',
  date: '05/08/2020',
  developer: 'Joe Average',
  ...
}
Registering the license data with AMD modules
require(['yfiles-umd/view-component'], yfiles => {
  yfiles.License.value =  {
    company: 'yWorks GmbH',
    date: '05/08/2020',
    developer: 'Joe Average',
    ...
  }
})

Development vs. Distribution License

There are two different kinds of yFiles for HTML licenses that are strictly intended for one of two different situations:

Development
During application development, the development license can be used. It allows unrestricted access and usage of the yFiles for HTML-based application in development but each CanvasComponent will show a watermark to indicate the usage of the development license. In development licenses, the distribution property is false.
Deployment
For final deployment, the distribution license must be used.

It is most important that for final deployment of a yFiles for HTML-based application, the development license must not be included. Instead, the distribution license must be included.

Licenses in Evaluation Packages

yFiles for HTML evaluation packages contain a development license that is valid for the evaluation period.

This license is in the file lib\license.json in the yFiles for HTML installation directory. For example, if the yFiles for HTML directory is located at C:\Users\Me\My Files\yFiles for HTML 2.x, the license file will be at C:\Users\Me\My Files\yFiles for HTML 2.x\lib\license.json.

All programming samples and tutorials load the license file using the relative path to this location.

Licenses for Purchased Packages

Non-evaluation packages of yFiles for HTML do not contain a license. Instead, a development license and a distribution license are provided directly to you.

Still, the programming samples and tutorials use the same relative path in the yFiles for HTML installation directory to reference the license. Thus, if you copy the development license to the .\lib\license.json location, all samples, etc. are set up.

A non-evaluation license cannot be used to activate an evaluation version of yFiles for HTML.

Resolving License Errors

If validating the license fails, yFiles for HTML logs an error to the developer’s console of the browser and shows an error dialog on top of the CanvasComponent. In both cases, the message contains a description of the actual problem.

The most common license errors and possible solutions are listed below. In case of doubt, do not hesitate to contact the support team.

Keep in mind that after updating the license, the old data might still be cached by the server or the browser, and you might get an unexpected error due to this. Caching is discussed in detail in the Web Browser Caching section.

Not valid for this version, subscription too old

If after updating to a new major version, you see a license error like "license is not valid for this version" or "subscription date is too old", you should update to the latest license that was provided to you.

If you have already updated the license and still get an error message, make sure it is not caused by a caching issue with your server or development environment.

Note that a license might also be accepted based on the subscription end date instead of its version property. In this case, an older license continues to work with the next major version. Nevertheless, we recommend that you update to the latest license if you are updating to a new major version anyway. For more details on this validation, read this knowledge base article.

License has expired

Normal yFiles for HTML licenses are valid for a specific major version including all corresponding bugfix releases, and never expire. Either you’re using an evaluation version or you have a special license agreement. In the former case, request an extension of your evaluation and if granted, exchange both the license and the library files. In the latter case, contact the sales department.

If you have already updated the license and still get an error message, make sure it is not caused by a caching issue with your server or development environment.

Invalid license data

This error is thrown if one of the properties of the license has been changed or removed. Note that the license validation is not based only on the key property.

If you have already updated the license and still get an error message, make sure it is not caused by a caching issue with your server or development environment.

If you need to change any data of the license, contact the sales department to get an updated version.

No license found

This error indicates that no license data was found at all. Make sure that the file with the license data is actually served at the intended URL, and that there is no CORS problem. If in doubt, consider including the license data in one of the existing source code files.

Evaluation vs. regular license

You can neither use an evaluation version of the library with a normal license, nor an evaluation license with the normal library, even if it is not expired and all other properties of the license would match. Use the corresponding license and library, instead, and read the knowledge base article about switching from an evaluation package to a purchased package for more details.

If you have already updated the license and still get an error message, make sure it is not caused by a caching issue with your server or development environment.

Evaluation has expired

Your evaluation version of yFiles for HTML has expired. You need to replace both the library files and the license with a new version, which you can request in the yWorks Customer Center.

If you have already updated the license and still get an error message, make sure it is not caused by a caching issue with your server or development environment.

Don’t hesitate to send a message to yWorks support or sales if you have questions or are encountering problems during evaluation.

Too strict Content Security Policy

In evaluation versions, license validation can fail due to a strict Content Security Policy. This is explained in more detail in this knowledge base article.

This license is not valid for yFiles for HTML

This error occurs if you use a license for a different package (the product type) than yours. Note that the type has to match exactly, a license for complete package cannot be used for a viewer package, even though the viewer classes are included in the complete package.

This error can also occur for a license which is not valid for yFiles for HTML but for a different yFiles library.