'Where should the MUI X Pro license key be installed?

I have a next app and recently bought a license for MUI. Where is the appropriate place to place the following setter for the license info? Does it have to be in the location of the component which uses it, in which case the key is available for the client browser to view?

import { LicenseInfo } from '@mui/x-data-grid-pro';

LicenseInfo.setLicenseKey(
  'x0jTPl0USVkVZV0SsMjM1kDNyADM5cjM2ETPZJVSQhVRsIDN0YTM6IVREJ1T0b9586ef25c9853decfa7709eee27a1e',
);


Solution 1:[1]

Where is the appropriate place to place the following setter for the license info? Does it have to be in the location of the component which uses it

You can set the license anywhere you wish in your application. Only make sure that you set the license key before your render the first component.

in which case the key is available for the client browser to view?

Correct.

Note that the license key is only meant as a reminder for developers to know when they are not licensed or using an outdated license. More details at https://mui.com/x/advanced-components/#license-key-installation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1