Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@octap/sdk

Latest version: v0.2.0

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
npm package Publisher: hieudepoet
2 Stars
0 Forks
3 Versions
250 Downloads
TypeScript Repo language

Scan summary

@octap/sdk was last scanned on 27 Nov 2026 at version 0.2.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions; the latest was published on 27 Nov 2026.
  • Findings: No rules fired in version 0.2.0.
  • Downloads: 250 downloads.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.0 LATEST 27 Nov 2026 No rules fired
0.1.0 18 Nov 2026 No rules fired
0.0.0-stage 18 Nov 2026 Not shown

No rules fired in 0.2.0

Findings

Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Node merchant SDK

src/client.ts is the merchant client (points and vouchers) over the REST transport in src/transports/. src/errors/ holds OctaSdkError and OctaApiError. src/webhooks.ts is the receiver side: verifyWebhookSignature checks x-octap-signature, and constructWebhookEvent checks it and returns the typed WebhookEvent (discriminated on type). Public DTOs come from the sibling contracts package. Do not import this package into browser code; browser helpers have their own package.

Verifying a customer

Your frontend gets an id_token from the browser SDK and sends it to your backend. Check it before acting for that customer, like Firebase Admin's verifyIdToken:

const { suiAddress, memberId, active } = await client.verifyCustomer(idToken);
if (!memberId) {
  // A valid Google sign-in that has not enrolled in your organization yet.
} else if (!active) {
  // Enrolled, but blocked: reward operations for this member will be refused.
}

An invalid or expired token throws OctaApiError with status 401. The call needs the read scope and writes nothing. Every merchant shares one OctaP Google client ID, so a token a customer showed to another merchant also verifies here: treat it as proof of who the customer is, not of consent to anything, and keep spending behind the customer's signature.

Merchant methods

Keep the API key on a trusted Node server. Console/platform session routes and API credential management are outside this client. Every method accepts RequestOptions with organizationId and signal, including both balance overloads.

Core routes SDK methods
POST /v1/credits/earn earnPoints({ organizationEndUserId, purchaseAmount, idempotencyKey })
POST /v1/credits/redeem/reserve, /finalize reservePosRedemption, finalizePosRedemption
POST /v1/credits/transactions/:id/reverse reverseTransaction
GET /v1/credits/members/:id/balance, /transactions getBalance, listTransactions
GET /v1/credits/budget getIssuanceBudget
GET /v1/rewards/refund-policy, GET .../history getVoucherRefundPolicy, listVoucherRefundPolicyHistory
POST/GET /v1/rewards/vouchers, GET/PATCH .../:id createVoucher, listVouchers, getVoucher, updateVoucher
POST .../vouchers/:id/claim, GET .../claims/:id claimVoucher, getVoucherClaim
POST .../vouchers/:id/grant grantVoucher
POST .../vouchers/use, /use/finalize prepareVoucherUse, finalizeVoucherUse
GET .../members/:id/vouchers listMemberVouchers
GET /v1/webhooks/endpoints listWebhookEndpoints
GET /v1/webhooks/deliveries listWebhookDeliveries

finalizeVoucherClaim is an alias for the shared finalize route. Customer signatures authorize finalization; no merchant credential is needed there. A read key is enough for every read here; a write key for the rest. The Owner registers, disables, enables and rotates webhook endpoints, replays deliveries and publishes the refund policy in the console, not with a key (removed from the SDK in 0.2.0, see CHANGELOG.md). List responses never include a webhook secret.

Earn

const accepted = await client.earnPoints({
  organizationEndUserId: memberId,
  purchaseAmount: 100000,
  idempotencyKey: 'purchase-order-42',
});
// At 100 bps: estimatedPoints=1000, pointsEarned=null, status=PENDING.
// Read listTransactions or consume credits.earn.confirmed for the actual point result.

A purchase too small to earn a point is rejected with 400, and an earn the issuance budget cannot cover with 422. An accepted earn that fails sends credits.earn.failed; its key stays used, so a retry needs a new key. History shows pointsAmount: null and a separate estimatedPoints until the chain confirms. Core has no operation-status route: observe transactions, balance, getVoucherClaim or webhooks. To debit points, use reservePosRedemption, return the bytes to the customer to sign, then call finalizePosRedemption. getBalance(programId, memberId, options) returns 404 for a program outside your organization.

Errors, cancellation and retries

OctaApiError exposes statusCode, statusText, responseBody, and retryAfter when Core sent that header. OctaNetworkError preserves the original cause. OctaRequestAbortedError distinguishes cancellation from server rejection. Do not log raw bodies, tokens, signatures or API keys.

const controller = new AbortController();
await client.getBalance(memberId, { signal: controller.signal });
// controller.abort() cancels local waiting; it does not roll back Core or the chain.

The SDK performs no automatic retries. Retry reads with bounded backoff, and wait retryAfter on a 429. For earn, reserve, reversal and claim retries, keep the same idempotency key and the same request: a retry returns the original transaction, and a changed request under a used key returns 409. After a timeout, cancellation, network failure or 5xx, read persisted state first, because the request may have committed. Never switch to a new key to recover an unknown outcome. Finalize must reuse the original signature and digest, or read the existing claim. Voucher redemption has no idempotency key: read its ownership status before retrying. Webhook registration and secret rotation are not idempotent, so do not blindly retry them.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @octap/sdk

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Frame 2085668439 (1)
Group 1261154229