The SDK integrates your application code with Hardpoint Connect. It's compatible with server-side JavaScript and TypeScript projects running on node 22 or greater.
The SDK can be installed like any other npm module:
npm i --save @hardpointlabs/sdk
Import the SDK and initialize it once when your application starts up:
import { Sdk } from '@hardpointlabs/sdk'
// Specify your Hardpoint Org ID
const sdk = Sdk.init({orgId: '<YOUR_ORG_ID>'})
Now you can connect to a service:
// ctx is a RequestContext object
await using tunnel = sdk.connect('postgres.prod', ctx)
// pass {tunnel} to your postgres client