@skinramp/ts-sdk
v0.0.5
Published
Skinramp TypeScript SDK
Readme
@skinramp/ts-sdk
Official TypeScript SDK for the Skinramp API.
Installation
npm install @skinramp/ts-sdk
# or
yarn add @skinramp/ts-sdk
# or
pnpm add @skinramp/ts-sdk
# or
bun add @skinramp/ts-sdkUsage
Create a Payment
import Skinramp from "@skinramp/ts-sdk";
const skinramp = new Skinramp("sk_live_...");
const paymentId = await skinramp.payments.create({
amount: 1000, // $10.00 in cents
gameId: "CS2", // optional: "CS2" | "ROBLOX" | "RUST"
metadata: { orderId: "order_123" }, // optional
});Verify Webhooks
import { Webhook } from "@skinramp/ts-sdk";
const webhook = new Webhook("whsec_...");
// In your webhook handler
const event = webhook.verify(rawBody, {
"webhook-id": req.headers["webhook-id"],
"webhook-timestamp": req.headers["webhook-timestamp"],
"webhook-signature": req.headers["webhook-signature"],
});
// event is typed as WebhookEvent<PaymentData>
console.log(event.type); // "payment.paid"
console.log(event.data); // { _id, amount, status, ... }License
MIT
