Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@vepler/http-client
Advanced tools
A flexible and extensible API service library for making HTTP requests with built-in authentication support for bearer tokens and API keys.
A flexible and extensible API service library for making HTTP requests with built-in authentication support for bearer tokens and API keys.
npm install @vepler/http-client
import ApiService from '@vepler/http-client';
// Create an instance of the API service
const api = ApiService.create({
host: 'https://api.example.com',
timeout: 5000,
logLevel: 'info',
headers: {
'Content-Type': 'application/json',
},
});
// Make a GET request
const response = await api.get('users', '123', {
token: 'your-bearer-token',
apiKey: 'your-api-key',
});
// Make a POST request
const newUser = await api.post('users', {
name: 'John Doe',
email: 'john@example.com',
}, {
token: 'your-bearer-token',
apiKey: 'your-api-key',
});
// Make a PUT request
const updatedUser = await api.put('users/123', {
name: 'John Doe',
email: 'john.doe@example.com',
}, {
token: 'your-bearer-token',
apiKey: 'your-api-key',
});
// Make a DELETE request
await api.delete('users', '123', {
token: 'your-bearer-token',
apiKey: 'your-api-key',
});
The create method of the ApiService accepts an options object with the following properties:
The API service supports authentication using bearer tokens and API keys. You can pass the token and apiKey properties as part of the queryParams object when making requests.
The API service includes built-in request and response interceptors for logging and error handling. You can customize or extend these interceptors by modifying the logRequest, interceptorResponseSuccess, and interceptorResponseError functions.
The API service includes error handling in case of network errors or invalid responses. Errors are thrown with a descriptive error message, which can be caught and handled in your application code.
This project is licensed under the MIT License.
FAQs
A flexible and extensible API service library for making HTTP requests with built-in authentication support for bearer tokens and API keys.
The npm package @vepler/http-client receives a total of 2 weekly downloads. As such, @vepler/http-client popularity was classified as not popular.
We found that @vepler/http-client 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.