@hardpointlabs/sdk
v1.0.8
Published
Hardpoint SDK
Readme
SDK
The SDK connects serverless functions to your services. It's compatible with JavaScript and TypeScript projects running on node 22 or greater.
[!TIP] Note! This is early alpha, Reach out directly on discord or X if you need help and we'll respond!
Getting started
Prerequisites
- A Hardpoint account and valid Org ID: Sign up for free to get one
- A JavaScript/TypeScript project running on Vercel
- The an agent configured to expose at least one service
Installation
The SDK can be installed like any other npm module:
npm i --save @hardpointlabs/sdkSetup
Import the SDK and initialize it once when your application starts up:
import { Sdk } from '@hardpointlabs/sdk'
// if you don't specify org id here, the SDK will
// fall back to the HARDPOINT_ORG_ID env var
const sdk = Sdk.init({org_id: '<YOUR_ORG_ID>'})Now you can connect to a service:
await using tunnel = sdk.connect('postgres.prod')
// pass {tunnel} to your postgres client