int64 ID Precision
Lofty entity IDs are 64-bit integers (JavaLong), but JavaScript’s Number only supports up to 2^53 - 1. Larger IDs are silently corrupted by JSON.parse():
Solutions
Best practices
Store and compare IDs as strings. Once you’ve safely parsed an ID out of the response, keep it as a string orBigInt for its entire lifetime in your application. When you need to compare two IDs, compare them as strings:
BigInt. Convert back to a string before serializing or sending the value back to the API.
Never use parseInt() on IDs. parseInt() converts its argument through a Number first, which means precision loss happens before you even try to parse it.
When sending IDs back to the API (in request bodies or query parameters), serialize them as their original string or BigInt.toString() value. The API accepts numeric strings in places where IDs are expected.