
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@evlt/apix-client
Advanced tools
A client for API-X (GitHub repository). This package provides an easy-to-use interface for interacting with API-X-based servers. The client is designed to be:
Full documentation at https://apix.evoluti.us/client.
You can install this package using npm:
npm install @evlt/apix-client
Or using yarn:
yarn add @evlt/apix-client
First, create an instance of ApiXClient
by providing your keyStore
:
import { ApiXClient, ApiXEnvironmentKeyStore } from '@evlt/apix-client';
const keyStore = ApiXEnvironmentKeyStore.shared; /// Only secure for backend environments.
keyStore.startupTest(); /// Will halt execution or throw if either key is not defined.
const client = new ApiXClient(keyStore);
const url = new URL('https://apix.example.com/endpoint');
client.makeGetRequest(url)
.then(response => console.log(response))
.catch(error => console.error(error));
const url = new URL('https://apix.example.com/endpoint');
const data = { key: 'value' };
client.makePostRequest(url, data)
.then(response => console.log(response))
.catch(error => console.error(error));
If you prefer more control over the request, you can create a request object first, modify it if needed, and then execute it:
const request = client.createPostRequest(url, data);
request.setHeader('Authorization', 'Bearer your-token');
request.make()
.then(response => console.log(response))
.catch(error => console.error(error));
ApiXClient
constructor(keyStore: ApiXKeyStore)
Creates a new instance of an API-X Client.
keyStore
: An object that securely retrieves the keys used in an API-X.createRequest(url: URL, httpMethod: ApiXHttpMethod, data?: ApiXJsonObject): ApiXRequest
ApiXRequest
object.createGetRequest(url: URL): ApiXRequest
makeRequest(url: URL, httpMethod: ApiXHttpMethod, data?: ApiXJsonObject): Promise<ApiXResponse>
Convenience Methods
makeGetRequest(url: URL)
, makePostRequest(url: URL, data?: ApiXJsonObject)
, makePutRequest(url: URL, data?: ApiXJsonObject)
, makeDeleteRequest(url: URL, data?: ApiXJsonObject)
, makePatchRequest(url: URL, data?: ApiXJsonObject)
: Simplified methods for common HTTP actions.ApiXRequest
For advanced usage, ApiXRequest
provides full control over individual requests, allowing for custom headers, cookies, and more.
The ApiXClient
can be easily extended for additional functionality, such as:
This package is licensed under the MIT License. See the LICENSE file for more information.
Contributions are welcome! Feel free to open issues or submit pull requests on the GitHub repository.
FAQs
A Node.js TypeScript API-X Client
The npm package @evlt/apix-client receives a total of 0 weekly downloads. As such, @evlt/apix-client popularity was classified as not popular.
We found that @evlt/apix-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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.