The Extension rig does NOT fully support
useBits, as extension monetization requires the Twitch page to create a dialog box where the process is handled, and this all takes place outside of the extension. If you use
setUseLoopBack and set that to true, then
useBits can be used in the rig but it’ll be entirely simulated and there wont be a dialog box. For full testing of bits you should test on Twitch on your test channel.
I’m not sure what you mean “is the compensation for Bits given before useBits”. When your extension runs the
useBits function, it’ll ask the user if they accept or deny it. If the user accepts then bits will be deducted from their balance,
onTransactionComplete will fire (as well as the API/EventSub topic for extension transactions), and it’ll be up to your extension logic (either in the client-side or server side) to handle whatever it is that is supposed to happen.
If your extension fails to do what the user exchanged their bits for, then that’s entirely your responsibility to handle. if they’ve spent their bits there will be a record of this on the Get Extension Transactions endpoint so you can be sure of exactly who has used their bits, on which channel with which SKU, and you can internally keep a record of which transactions have/haven’t been fulfilled by your extension.