angular-cybershield
v1.0.6
Published
Angular integration library for CyberShield WAF
Readme
angular-cybershield
Angular integration for the CyberShield WAF. Automatically redirects users to the security block page when a request is blocked by the backend (403 or 429 with { blocked: true, redirect: "..." }).
Installation
npm install angular-cybershieldUsage
Open your app.config.ts and add the following:
import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';
import {
provideHttpClient,
withFetch,
withInterceptors
} from '@angular/common/http';
import { cybershieldInterceptorFn, initCyberShield } from 'angular-cybershield';
import { routes } from './app.routes';
// Activates global protection for fetch() and XMLHttpRequest (Axios, etc.)
initCyberShield();
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
provideHttpClient(
withFetch(),
withInterceptors([cybershieldInterceptorFn])
)
]
};What is protected?
| Request type | Protected |
|---|---|
| Angular HttpClient | ✅ via cybershieldInterceptorFn |
| Native fetch() | ✅ via initCyberShield() |
| Axios / XMLHttpRequest | ✅ via initCyberShield() |
