Create a .npmrc file and add:
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=<TOKEN>
From [https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers#installing-pro]
Install npm package
For FREE
npm i -D @fortawesome/fontawesome-free
For PRO
npm i -D @fortawesome/fontawesome-pro
Now for example in ngx-admin need to register the FontPacks and set one as default in the app.component.ts.
(EDIT NOTE: originally I indicated to add the below to the pages.component.ts, this is the wrong place as if there is a menu in the header component which is outside the pages component, even if the menu doesn't use FA icons, the web app will hang the browser when you click on that menu, so make sure to add to app.component.ts to ensure all menus now about it.)
import '@fortawesome/fontawesome-pro/css/all.css';
import '@fortawesome/fontawesome-pro/js/all.js';
...
constructor(private iconLibraries: NbIconLibraries) {
this.iconLibraries.registerFontPack('solid', {packClass: 'fas', iconClassPrefix: 'fa'});
this.iconLibraries.registerFontPack('regular', {packClass: 'far', iconClassPrefix: 'fa'});
this.iconLibraries.registerFontPack('light', {packClass: 'fal', iconClassPrefix: 'fa'});
this.iconLibraries.registerFontPack('duotone', {packClass: 'fad', iconClassPrefix: 'fa'});
this.iconLibraries.registerFontPack('brands', {packClass: 'fab', iconClassPrefix: 'fa'});
this.iconLibraries.setDefaultPack('duotone');
}
From [https://github.com/akveo/nebular/issues/1677]
And at this point say in the pages.menu.ts to configure nb-menu can just add the FA icon names to the icon attributes e.g.:
export const MENU_ITEMS: NbMenuItem[] = [
{
title: 'Some Title',
icon: 'location',
link: '/your/link'
}
];
which result in 'fad fa-location' being shown because the duotone is the font pack set.