Skip to content
Scalekit Docs

Node.js SDK

Install

GitHub
npm install @scalekit-sdk/node
v2.16.1TypeScriptESM ReadyUpdated 3 days ago

Initialize

Initialize the client
import { ScalekitClient } from '@scalekit-sdk/node';
const scalekit = new ScalekitClient(
process.env.SCALEKIT_ENVIRONMENT_URL,
process.env.SCALEKIT_CLIENT_ID,
process.env.SCALEKIT_CLIENT_SECRET
);
export default scalekit;
v2.12.0

What's Changed

Scalekit v2.12.0 introduces encrypted-session middleware, mirroring the Python SDK’s middleware.

This release also includes a security fix by bumping axios to a more secure version. The middleware is framework-agnostic, with adapters for Express and Next.js, and includes features like transparent session refresh, full logout, and configurable local or full logout.

v2.11.0

What's Changed

  • [SK-1339] feat: typed updateLoginUserDetails response + listEventsPaginated by @AkshayParihar33 in #210
  • [SK-1357] Sanitize AxiosError to avoid leaking client_secret on token exchange failure by @claude[bot] in #209

New Contributors

Full Changelog: v2.10.0...v2.11.0

v2.8.0

Release Notes

This release introduces configurable timeouts for management APIs and tool-call APIs.

  • New timeoutMs option — timeout for management API calls (organizations, users, connections, etc.). Default: 20 seconds.
  • New toolTimeoutMs option — timeout for tool-call APIs (tools.*, actions.executeTool, actions.request), which can run longer as they call third-party providers. Default: 60 seconds.

const scalekit = new ScalekitClient(envUrl, clientId, clientSecret, {
timeoutMs: 20_000,
toolTimeoutMs: 60_000,
});

  • Calls that exceed the timeout now throw ScalekitGatewayTimeoutException instead of waiting indefinitely.
  • Invalid timeout values (zero or negative) throw an error at client creation.
  • actions.request default timeout changed from 30 to 60 seconds; it can still be overridden per call with timeoutMs.

Full Changelog: v2.7.0...v2.8.0