
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
apinow-sdk
Advanced tools
A TypeScript SDK for interacting with ApiNow endpoints, supporting Ethereum and Base chains. This SDK simplifies payments by automatically handling 402 Payment Required
responses, including on-the-fly token swaps.
402
responses to handle payment flows automatically.search
method to find endpoints semantically.npm install apinow-sdk
# or
yarn add apinow-sdk
The primary way to use the SDK is with the execute
method. It's a single call that handles all the complexity of API payments for you.
import apiNow from 'apinow-sdk';
// Your private key, securely stored (e.g., in an environment variable).
const YOUR_WALLET_PRIVATE_KEY = process.env.USER_PRIVATE_KEY;
async function main() {
try {
// The `execute` method handles everything automatically.
// If the API requires a payment (402), the SDK will find the best
// token you hold, swap if necessary, send the payment, and retry
// the original request with proof of payment.
const response = await apiNow.execute(
'https://apinow.fun/api/endpoints/apinowfun/translate-TRANSLATE',
YOUR_WALLET_PRIVATE_KEY,
{ // Optional: request options
method: 'POST',
data: {
text: 'Hello world',
selectedLanguage: 'es'
}
}
);
console.log('API Response:', response);
} catch (error) {
console.error('Operation failed:', error);
}
}
main();
For a complete, runnable example, see example.js
.
When you call execute
, the SDK makes a request to the endpoint. If the server responds with a 402 Payment Required
status, the SDK automatically performs the following steps:
402
response contains a list of accepted payment options.['USDC', 'WETH', 'ETH']
).execute(endpoint, privateKey, opts?, paymentConfig?)
Handles a request and its potential payment in a single, automatic call. This is the recommended method.
search(params, privateKey, paymentConfig?)
Performs a semantic search for endpoints.
info(endpointUrl)
Retrieves public, detailed information about an endpoint.
https://rpc.ankr.com/eth
https://mainnet.base.org
The SDK throws descriptive errors for:
Wrap calls in try...catch
blocks for robust error handling.
This SDK uses node-fetch
, making it compatible with:
It is NOT directly compatible with browsers or edge environments that do not provide a Node.js-compatible fetch
API.
MIT
FAQs
ApiNow SDK · The endpoint vending machine
The npm package apinow-sdk receives a total of 86 weekly downloads. As such, apinow-sdk popularity was classified as not popular.
We found that apinow-sdk 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
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.