
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@admiral-vrm/sdk-node
Advanced tools
The Admiral SDK for NodeJS simplifies the process of using Admiral's APIs for applications written in server-side JavaScript.
Provides a simple interface for using Admiral's APIs for applications written in server-side JavaScript. Visit us at Admiral for more information.
Node.js 18 or later (see engines in package.json).
Install the package to your project:
npm install @admiral-vrm/sdk-node
# or
yarn add @admiral-vrm/sdk-node
This package has peer dependencies (@edge-runtime/cookies, @noble/hashes v1.x, plus React/Next when using those features). Next.js apps typically satisfy these. If you use the SDK in a non-Next environment (e.g. Express or plain Node), install the peers manually if needed. Use @noble/hashes v1.x; v2.x uses different export paths and is not yet supported.
npm install @edge-runtime/cookies @noble/hashes@^1.7.0
"A-1234-1").ADMIRAL_TOKEN_SECRET_KEY.proxyAdmiral: true, set proxy.host (and optionally scheme, prefix).partnerApiEndpoint, cacheTimeout. API credentials are configured inside the Protect integration (see examples).The Admiral class is the main class for the Admiral SDK. It contains configuration
for the Admiral object, such as the property ID, environment, enabling Protect and
Proxy, and additional parameters.
export const admiral = new Admiral({
propertyID: "A-1234-1",
environment: "production",
protect: true,
proxyAdmiral: true,
tokenSecretKey: process.env.ADMIRAL_TOKEN_SECRET_KEY, // recommended for production
proxy: {
host: "host.com",
scheme: "https",
},
});
The class provides the following methods:
Returns an array of possible Admiral prefix handlers that can be used as prefixes when using the proxy functionality.
Returns path prefixes that match proxy routes (e.g. ["/abcde.../", "/fghij.../"]).
No I/O. Use for gate checks or diagnostics. Prefixes rotate over time; treat as
runtime routing hints, not static invariants.
Returns the current (today's) proxy path prefix (e.g. "/abcde.../"), or "" if
none. Same as getPossibleProxyPathPrefixes()[0]. No I/O.
Returns true if the request or URL matches a proxy path. Accepts a full URL, pathname, or MiddlewareRequest. No I/O. Use before calling the SDK to skip non-Admiral requests (gate-first pattern).
Returns current proxy handlers, path prefixes, the current (today's) prefix, and generation time. For admin/debug use only; restrict access and do not expose publicly.
Fetches Admiral bootstrap scripts for server-side rendering. Returns a promise containing:
admiral: Array of bootstrap script strings, each of these should be script tagsFetches Admiral bootstrap scripts. Returns a promise containing an array of script strings.
Renders the Admiral bootstrap scripts for server-side rendering as React components. Takes a bootstrap wrapper payload from fetchSSRBootstraps and returns an array of React script elements.
Parameters:
payload: Object containing array of bootstrap scripts under admiral keyHandles Admiral middleware functionality including proxy requests and Protect functionality. Returns a promise containing the middleware response with:
response: Response object (optional)headers: Headers object (optional)cookies: ResponseCookies object (optional)Parameters:
req: MiddlewareRequest object containing the incoming request detailsYou can instead use the split handlers and a gate for more control:
isProxyRequest(url)).fetchSSRBootstraps() or the Install API)
and caches them on your CDN. You do not need to call the Install API at
runtime for every user.admiral.isProxyRequest(url) first and only invoke the SDK when
it returns true (or when the URL is a Protect token/reset URL). See the
nextjs and expressjs examples for a gate-first middleware pattern.yourdomain.com/<prefix>/...), so the host stays first-party and is not
filtered. Expose any routing diagnostics (e.g. getProxyRoutingInfo()) only
to admin/debug audiences, not publicly.See the nextjs example for more information with a full example and documentation on how to use the Admiral SDK with Next.js.
The ProtectEmbed component is a React component that can be used to embed the
Protect functionality into a React application.
See the expressjs example for more information with a full example and documentation on how to use the Admiral SDK with Express.
The ProtectHTMLEmbed library allows embedding HTML with Protect functionality into
your application without using React.
FAQs
The Admiral SDK for NodeJS simplifies the process of using Admiral's APIs for applications written in server-side JavaScript.
We found that @admiral-vrm/sdk-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.