hs-playlib
v0.6.0
Published
Hyperswitch Payments SDK — Node.js client for connector integrations via UniFFI FFI
Readme
JavaScript Payments SDK
Calls the connector FFI layer directly from Node.js using the same UniFFI shared
library as the Python and Kotlin SDKs. Uses koffi to call the C ABI —
no NAPI required.
Prerequisites
- Rust toolchain (
cargo) - Node.js 18+
npm
Setup
# Build Rust lib, generate bindings and proto stubs, build tarball
make packTest
# Verify the packed tarball installs and the FFI layer works end-to-end
make test-pack
# With full round-trip (requires valid Stripe test key)
STRIPE_API_KEY=sk_test_your_key make test-packtest-pack installs the tarball into an isolated temp directory and runs
test_smoke.js, which asserts the connector request URL and method, then
optionally exercises the full HTTP round-trip if STRIPE_API_KEY is set.
Distribution
# Build tarball containing all available platform binaries (for CI / release)
make dist
# → artifacts/sdk-javascript/hyperswitch-payments-0.1.0.tgzHow it works
make build-lib— buildsbackend/ffiwith--features uniffimake generate-bindings— symlinks the.dylib/.sointogenerated/make generate-proto— runspbjsto producegenerated/proto.jsandproto.d.tsmake pack-archive— runsnpm packto produce the installable.tgz
Architecture
src/payments/connector_client.js — high-level authorize() with HTTP round-trip
src/payments/uniffi_client.js — UniFFI C ABI wrapper using koffi (RustBuffer protocol)
src/payments/generated/proto.js — protobufjs static module (generated)
src/payments/generated/libconnector_service_ffi.* — native shared libraryNo code generation needed for JS — uniffi_client.js manually implements the
UniFFI RustBuffer serialization protocol.
