
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@xylabs/api
Advanced tools
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Using npm:
npm install {{name}}
Using yarn:
yarn add {{name}}
Using pnpm:
pnpm add {{name}}
Using bun:
bun add {{name}}
See the LICENSE file for license rights and limitations (LGPL-3.0-only).
### .temp-typedoc
### classes
### <a id="ApiClient"></a>ApiClient
Abstract base class for API clients that provides stage and token configuration.
new ApiClient(token?, stage?): ApiClient;
string | null
ApiClient
protected optional stage?: ApiStage;
protected optional token?: string | null;
abstract endPoint(): string;
string
### <a id="ApiEndpoint"></a>ApiEndpoint
Generic REST API endpoint wrapper that supports fetching and inserting typed data.
T
The type of data returned by the endpoint
new ApiEndpoint<T>(config, path): ApiEndpoint<T>;
string
ApiEndpoint<T>
get value(): T | undefined;
T | undefined
fetch(): Promise<T>;
Promise<T>
get(): Promise<T | NonNullable<T>>;
Promise<T | NonNullable<T>>
insert(value): Promise<T>;
T
Promise<T>
### functions
### <a id="getApiStage"></a>getApiStage
function getApiStage(hostname): "beta" | "local" | "prod";
Determines the API stage based on the hostname.
string
The hostname to evaluate
"beta" | "local" | "prod"
The corresponding ApiStage (Local, Beta, or Prod)
### interfaces
### <a id="ApiConfig"></a>ApiConfig
Configuration for connecting to an API, including domain, authentication, and user identification.
apiDomain: string;
optional apiKey?: string;
optional jwtToken?: string;
optional userid?: string;
### type-aliases
### <a id="ApiStage"></a>ApiStage
type ApiStage = EnumValue<typeof ApiStage>;
A valid API stage value ('prod', 'beta', or 'local').
### variables
### <a id="ApiStage"></a>ApiStage
const ApiStage: Enum<{
Beta: "beta";
Local: "local";
Prod: "prod";
}>;
Deployment stage identifiers for API environments.
FAQs
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
The npm package @xylabs/api receives a total of 3,517 weekly downloads. As such, @xylabs/api popularity was classified as popular.
We found that @xylabs/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.