Configure a Blazorise ProductToken

Get the ProductToken from your Blazorise account and configure it for your application's hosting model.

Get your ProductToken

Go to your Blazorise account and sign in. The ProductToken is created from the license registered to that account.

  1. Open the License section of your account.

  2. For a commercial license, make sure the purchased License Key is registered to your account. If the account asks for the License Key, enter it there. Do not copy it into your application.

  3. Select Generate to create the ProductToken for the registered license, then copy the generated value.

  4. Configure the copied ProductToken as BlazoriseOptions.ProductToken using the guidance below.

If your license is missing from the account or you cannot generate a ProductToken, contact Blazorise support.

See the licensing overview for a comparison of the License Key and ProductToken.

ASP.NET Core and Blazor Server

For a server-hosted application, read the ProductToken from an ASP.NET Core configuration provider instead of hardcoding it in Program.cs, Startup.cs, or another source file.

Configure Blazorise

The following example reads Licensing:ProductToken from the application configuration.

builder.Services
    .AddBlazorise(options =>
    {
        options.ProductToken =
            builder.Configuration["Licensing:ProductToken"];
    });

Local development

Use .NET User Secrets for local development. Run this command from the application project directory:

dotnet user-secrets set "Licensing:ProductToken" "YOUR_PRODUCT_TOKEN"

User Secrets keep the ProductToken outside the project directory. Do not put a real ProductToken in a committed appsettings.json file.

Production

Use an environment variable or a secret-management service. The environment variable for the configuration key used above is:

Licensing__ProductToken

ASP.NET Core automatically maps double underscores in environment-variable names to configuration section separators. Set the value in the deployment environment, not in a source-controlled file.

CI/CD

Store the ProductToken in GitHub Actions Secrets, Azure DevOps secret variables, GitLab CI/CD variables, or the equivalent secret store for your platform. Inject it into the build or deployment environment. Do not write the value directly in a workflow YAML file or another pipeline file.

Protecting your ProductToken

A ProductToken is intended for application use and is not considered secret data in the same way as a License Key. You should still avoid publishing it where it is not needed.

  • Avoid committing a ProductToken to a public repository or publishing it in documentation.

  • Prefer not to commit a ProductToken to source control when configuration is practical. Do not treat a private repository as a secret store.

  • For server-hosted applications, use configuration providers instead of hardcoding the ProductToken.

  • For Blazor WebAssembly, deliberately embedding the ProductToken in application code is acceptable and is often preferable to publishing it in a plain configuration file.

  • Use .NET User Secrets for local development.

  • Use environment variables or a secret-management service for production.

  • Use the secret store provided by your CI/CD system.

If a ProductToken is published unintentionally, remove it from locations where it is not needed. If you need a replacement, check your Blazorise account or contact Blazorise support for the currently available options.

Blazor WebAssembly

You can use application configuration in Blazor WebAssembly, but the configuration file must be served to the browser, usually from wwwroot. That makes the value directly readable. For this reason, embedding the ProductToken in application code is often preferable:

options.ProductToken = "YOUR_PRODUCT_TOKEN";

Embedding the ProductToken can make casual discovery harder than placing it in a plain configuration file, but it does not make the value secret. Environment variables, CI/CD secrets, and User Secrets can protect the ProductToken during development and deployment. They cannot make it secret after it has been included in files shipped to the browser.

ProductTokens have limited validity and can change over time. Update the deployed ProductToken when required. Avoid publishing it in public repositories, documentation, sample code, logs, and other locations where it is not needed.

On this page