Testing Bits IAPs in Extension

I have an extension which is Bits enabled, however I was wondering: How do I go about testing Bits purchases while building? What’s the best way?

Use the developer rig

https://github.com/twitchdev/developer-rig

and verse thyself in the documentation on Using/Testing Bits in Extension

Thanks for the reply Barry. The only reference to Bits I see in that documentation relates to “Managing Bits Products”. I don’t see anything about testing, unless I’m missing something?

Perhaps.

The dev rig lets you create the SKUs that you buy with bits.

You can set these SKUS to “dev mode” and then those SKUS should work for testing inside/outside the rig.

So what is the process everyone uses to test Bits are functioning as intended in their extension? We have an error, but don’t know if that’s because Bits aren’t working or we’re testing incorrectly.

Has anyone got any further with ideas on how to test Bits? It seems like in order to test them on my own channel - I need to be an Affiliate? But I only have a static screen so do not qualify. Any other ideas or do I have to find a streamer that is an Affiliate to test??

You can test bits in the rig using setUseLoopback(true); from the helper function. This way when you call useBits(SKU) it’ll simulate a transaction and call the callback you’ve set in onTransactionComplete(transaction => ...). The rig can’t currently simulate Twitch’s dialog box, so if you try set this to false you’ll run into issues when attempting to call useBits(SKU).

You can also test on a Twitch channel by setting setUseLoopback(false) and then when you call useBits(SKU) you’ll get Twitch’s dialog box asking you to confirm/cancel/buy bits. This can be done on a channel you’ve set as a test channel for your extension, even if it’s not an affiliate or partner.

It’s also worth noting that if your product SKU is set to in development then it wont actually subtract bits from a users account so that you can test the bits purchasing stuff without actually spending bits.

3 Likes

Ah I know all about setUseLoopback() - but “This can be done on a channel you’ve set as a test channel for your extension” - is this done in the dashboard? Is it under “Access” and then “Testing Accounts” or the “Broadcaster Whitelist”? Thanks for your clarification!

Yes, it’s that “Testing Accounts” box where you list the channel ID of any accounts that you want access to install and use the extension while it’s still in development. The “Broadcaster Whitelist” limits what channels can install the extension once it’s fully released.

1 Like

Ahhh ok thats cool. I’ve been testing everything using the loopback but now I can try do it online! Wonder if it will work lol thanks!