@hamduktrustlayerai/sdk
v0.1.2
Published
TypeScript SDK for TrustLayer AI transaction risk, trust scoring, credit analysis, and assistant APIs.
Maintainers
Readme
@hamduktrustlayerai/sdk
TypeScript SDK for TrustLayer AI.
Install
npm install @hamduktrustlayerai/sdkUsage
import TrustLayer from "@hamduktrustlayerai/sdk";
const tl = new TrustLayer({
apiKey: "tl_live_...",
baseUrl: "https://trustlayerai.labs.hamduk.com.ng/api"
});
const result = await tl.transaction.analyze({
customer_id: "customer_123",
amount: 300000,
currency: "NGN",
merchant: "POS Terminal",
location: "Abuja",
device_id: "device_abc",
channel: "mobile"
});
console.log(result);Methods
tl.transaction.analyze(payload)
tl.customer.register(payload)
tl.customer.getProfile(externalId)
tl.credit.analyze(payload)
tl.assistant.chat(customerId, message, history)
tl.webhooks.register(payload)Sandbox Mode
const tl = new TrustLayer({
apiKey: "tl_sandbox_...",
baseUrl: "https://trustlayerai.labs.hamduk.com.ng/api",
sandbox: true
});Publish
From the monorepo root:
npm --workspace @hamduktrustlayerai/sdk run build
npm version patch --workspace @hamduktrustlayerai/sdk
npm publish --workspace @hamduktrustlayerai/sdk --access public