JavaScript SDK
The official Node.js client for SpaceRouter Proxy. Promise-based API, TypeScript types included.
Install
npm install @spacenetwork/spacerouterSPACE-payment example
import { SpaceRouter, SpaceRouterSPACE } from "@spacenetwork/spacerouter";
const payment = new SpaceRouterSPACE({
gatewayMgmtUrl: "https://gateway.spacerouter.org",
wallet, // your ClientPaymentWallet
});
const router = new SpaceRouter("0xYOUR_WALLET_ADDRESS", {
gatewayUrl: "https://gateway.spacerouter.org",
payment,
region: "KR",
ipType: "residential",
});
const response = await router.get("https://httpbin.org/ip");
console.log(await response.json());
router.close();Constructor
Methods
The response object
Errors
Class
HTTP
Raised when
Pay with SPACE
Last updated
Was this helpful?