Skip to main content

Ag-grid License Key Example -

import LicenseManager from 'ag-grid-enterprise'; LicenseManager.setLicenseKey('your_license_key_here'); :

export default components: AgGridVue , data() return columnDefs: [ field: 'make' , field: 'model' , field: 'price', aggFunc: 'sum' ], rowData: [ make: 'Toyota', model: 'Celica', price: 35000 ] ;

; </script> | Practice | Recommendation | |----------|----------------| | Never hardcode in client-side code | For open-source apps, the key can be inspected. Use only if your app is distributed privately. | | Environment variables | Store key in .env and reference as process.env.VUE_APP_AG_GRID_LICENSE (or framework equivalent). | | Backend injection | Have your backend serve the license key to the frontend after authentication. | | Single initialization | Call LicenseManager.setLicenseKey() once at app startup, not per grid instance. | | CI/CD safety | Do not commit license key to version control. Use secrets manager. | Example using environment variable (React + Webpack) LicenseManager.setLicenseKey(process.env.REACT_APP_AG_GRID_LICENSE); .env file:

import Component from '@angular/core'; @Component( selector: 'app-root', template: <ag-grid-angular style="width: 100%; height: 500px;" class="ag-theme-alpine" [rowData]="rowData" [columnDefs]="columnDefs" [pivotMode]="true"> </ag-grid-angular> ) export class AppComponent columnDefs = [ field: 'make' , field: 'model' , field: 'price', aggFunc: 'sum' ]; rowData = [ make: 'Toyota', model: 'Celica', price: 35000 ]; ag-grid license key example

import createApp from 'vue'; import App from './App.vue'; import LicenseManager from 'ag-grid-enterprise'; LicenseManager.setLicenseKey('your_license_key_here'); createApp(App).mount('#app');

ag-grid_the_company_name_2023_10_01_2024_09_30_1_0_ABC123DEF456... Step 1: Install AG-Grid Enterprise npm install ag-grid-enterprise Step 2: Set License Key Before Grid Initialization import LicenseManager from 'ag-grid-enterprise'; // Set license key once in your app entry point LicenseManager.setLicenseKey( 'your_license_key_here_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ); Step 3: Initialize Grid import Grid from 'ag-grid-community'; const gridOptions = columnDefs: [ field: 'make' , field: 'model' , field: 'price' ], rowData: [ make: 'Toyota', model: 'Celica', price: 35000 , make: 'Ford', model: 'Mondeo', price: 32000 ], // Enterprise feature example pivotMode: true ;

const eGridDiv = document.getElementById('myGrid'); new Grid(eGridDiv, gridOptions); | | Backend injection | Have your backend

If the license is missing or invalid, a watermark appears. 5.1 React App.js or entry point:

export default App; main.ts :

return ( <div className="ag-theme-alpine" style= height: 400, width: '100%' > <AgGridReact columnDefs=columnDefs rowData=rowData pivotMode=true // Enterprise only /> </div> ); ; Use secrets manager

main.js :

import React from 'react'; import LicenseManager from 'ag-grid-enterprise'; import AgGridReact from 'ag-grid-react'; import 'ag-grid-community/styles/ag-grid.css'; import 'ag-grid-community/styles/ag-theme-alpine.css'; LicenseManager.setLicenseKey('your_license_key_here');

Schedule a demo

See the OnePlace Solutions product suite in action and unlock the potential of your data by leveraging the SharePoint platform.

Try free

Download and try the full OnePlace Solutions product suite for Windows Desktop and Apps for Microsoft 365.

Contact us

We're here to help, so please don’t hesitate to get touch with any questions you may have.