
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
ngx-runtime-initializer
Advanced tools
Angular package for loading runtime configuration, managing app settings, and injecting services with post-initialization callbacks, compatible with standalone Angular 19+ applications.
NgxRuntimeInitializer is an Angular utility for loading runtime configuration from JSON, managing global app settings, and optionally injecting services with post-initialization callbacks. Perfect for SSR, feature toggles, and dynamic environment configuration.
config.json or custom URL) at app initialization.apiURL, debug, requestTimeout).Install via npm:
npm install ngx-runtime-initializer
// config.json
{
"coreConfig": {
"apiURL": "https://api.example.com",
"debug": true,
"requestTimeout": 30000
},
"status": true
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { provideRuntimeInitializer } from 'ngx-runtime-initializer';
bootstrapApplication(AppComponent, {
providers: [provideRuntimeInitializer()],
});
✅ Loads
config.jsonwith default behavior.
import { RuntimeInitializerOptions, provideRuntimeInitializer } from 'ngx-runtime-initializer';
import { MyService1, MyService2 } from './services';
bootstrapApplication(AppComponent, {
providers: [
provideRuntimeInitializer(
new RuntimeInitializerOptions(
'/assets/runtime-config.json',
[MyService1, MyService2],
async (config, services) => {
console.log('Config loaded:', config);
services.MyService1?.initialize();
},
(error, services) => {
console.warn('Failed to initialize runtime config:', error);
}
)
),
],
});
import { inject } from '@angular/core';
import { AppConfigService } from 'ngx-runtime-initializer';
const appConfigService = inject(AppConfigService);
// Full config
const config = appConfigService.getConfig();
// Specific property
const apiURL = appConfigService.getConfigProperty<string>('coreConfig')?.apiURL;
// Reactive signal
const configSignal = appConfigService.getConfigSignal();
import { InMaintenanceGuard, MaintenanceGuard, createStatusGuard } from 'ngx-runtime-initializer';
{
path: 'maintenance',
canActivate: [InMaintenanceGuard]
}
{
path: '',
canActivate: [MaintenanceGuard]
}
// Or create a custom guard
{
path: 'custom',
canActivate: [createStatusGuard(true, '/maintenance')]
}
Class to configure the runtime initializer.
Constructor
new RuntimeInitializerOptions(
configUrl?: string,
servicesToInject?: Type<any>[],
postInit?: (config: AppConfig, services: Record<string, any>) => Promise<void>,
handleInitializationFailure?: (error: any, services: Record<string, any>) => void
)
Defaults:
configUrl = 'config.json'servicesToInject = []postInit = async () => {}handleInitializationFailure = () => {}Provides an Angular provideAppInitializer — equivalent to APP_INITIALIZER in pre-standalone Angular versions — to load runtime configuration.
getConfig(): AppConfig — Returns full config.getConfigProperty<T>(key: keyof AppConfig): T | undefined — Returns a specific property.getConfigSignal(): WritableSignal<AppConfig> — Reactive configuration.getStatus(): boolean — Returns app status.Default configuration class:
coreConfig = { apiURL: '__BACKEND__', debug: false, requestTimeout: 30000 };
status = false;
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Angular package for loading runtime configuration, managing app settings, and injecting services with post-initialization callbacks, compatible with standalone Angular 19+ applications.
The npm package ngx-runtime-initializer receives a total of 6 weekly downloads. As such, ngx-runtime-initializer popularity was classified as not popular.
We found that ngx-runtime-initializer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.