
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ngx-apiwrapper
Advanced tools
A wrapper for Angular's HttpClient for easy consumption of api endpoints
This project has been put together with the aim of minimising the complexity of building repetitive HttpClient methods.
npm install ngx-apiwrapper
Add the provider to you app.config.ts (assuming you are running in standalone mode)
import { provideNgxApiWrapper } from 'ngx-apiwrapper'
export const appConfig: ApplicationConfig = {
providers: [
provideNgxApiWrapper({
availableApis: {
yourApi: 'yourfirstapi.com',
aws: 'yourAWSApi',
azure: 'yourAzureApi'
},
defaultApi: 'yourApi'
})
]
}
Define your service, inject the wrapper, and call the wrapper
@Injectable({ providedIn: 'root' })
export class APIService {
private readonly _wrapperService: ApiWrapperService = inject(ApiWrapperService);
yourMethod() {
return this._wrapperService.get('your-endpoint');
}
}
The wrapper is designed to wrap up common functionality, and can be used alongside a traditional guard for authorization.
By defining the api base url in the provider, you only need to pass in the specific endpoint when you make the call to the wrapper service.
Each method accepts a path input, where you define the endpoint and an options object allowing you to define additional properties like headers or parameters.
The POST and PUT methods both accept a body input as well.
The API Options allow you to pass a number of additional options.
Alongside this, any required headers defined in the config will be applied by default.
export interface APIOptions {
apiName?: string;
headers?: HttpHeaders | { [header: string]: string | string[] };
params?:
| HttpParams
| {
[param: string]:
| string
| number
| boolean
| ReadonlyArray<string | number | boolean>;
};
overridePath?: boolean;
version?: number;
logToConsole?: boolean;
ignoreErrors?: boolean;
withCredentials?: boolean;
reportProgress?: boolean;
observe?: 'body' | 'events' | 'response';
errorOverride?: (err: HttpErrorResponse) => Observable<never>;
responseType?: 'arraybuffer' | 'blob' | 'text' | 'json';
}
FAQs
A wrapper for Angular's HttpClient for easy consumption of api endpoints
The npm package ngx-apiwrapper receives a total of 0 weekly downloads. As such, ngx-apiwrapper popularity was classified as not popular.
We found that ngx-apiwrapper 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.