Unity IAP Validate Typescript Runtime doc missing

we want to validate the Unity IAP, we can see the doc have Go runtime code, but no Typescript. we can find the corresponding API for validate, but cannot find any doc for the error handle

for example, what corresponding code in TS for this part of code?

if err != nil {
        if err == runtime.ErrPurchaseReceiptAlreadySeen {
            logger.WithField("err", err).Warn("Receipt replay attack.")
        } else {
            logger.WithField("err", err).Error("Receipt validation error.")
        }
        return ErrBadInput
}

Hello @mengxin,

The docs are outdated, we’ve taken note to update them - if the receipt has already been used, the validation APIs won’t return an error, but instead will have a property seenBefore in the validated receipt set to true (nakama-common/index.d.ts at master · heroiclabs/nakama-common · GitHub).

You should inspect that property and log (and potentially surface an error) if the value is true.

Hope this clarifies.