# Best practice for network error after Bit transaction?

**URL:** <https://staging-discuss.dev.twitch.com/t/best-practice-for-network-error-after-bit-transaction/27681>\
**Category:** Extensions\
**Created:** [August 13, 2020, 5:57am UTC](https://staging-discuss.dev.twitch.com/t/best-practice-for-network-error-after-bit-transaction/27681 "2020-08-13T05:57:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [August 13, 2020, 10:45am UTC](https://staging-discuss.dev.twitch.com/t/best-practice-for-network-error-after-bit-transaction/27681/2 "2020-08-13T10:45:28Z")

</div>

> [@voidedpigeon](#):
>
> Does the viewer’s auth token expire and need manual refreshing?

usually the Twitch Extension Handler auto refreshes the JWT, so you shouldn’t get a JWT/auth error

> [@voidedpigeon](#):
>
> I imagine this could be due to network failure but I have also experienced this myself after having an Extension open for a prolonged period of time (\> 24 hours) on a laptop that was sleeping for part of that time.

I do a Basket type flow. So user clicks a button, I check the JWT is still good on my EBS, and the user then gets the bits button to ok/click, then the Twitch Bits popuo

> [@voidedpigeon](#):
>
> It appears there are times when a Bit transaction is invoked (twitch.bits.useBits) and confirmed by the viewer but the Extension is never notified

Webhooks!! Extensions have a transaction webhook.

[https://dev.twitch.tv/docs/api/webhooks-reference#topic-extension-transaction-created](https://dev.twitch.tv/docs/api/webhooks-reference#topic-extension-transaction-created)

So you can compare webhooks, or the API endpoint with your inbound collected data.

> [@voidedpigeon](#):
>
> Additionally, are there any ways or plans to require ‘consuming’ the transaction (like what Apple and Google do on their mobile platforms)?

I actually proposed a PayPal style approach when bits in extensions first came out, looooooong ago (and before uservoice existed), post to create a transaction then the bits usage would fulfill that payment, and this is roughly what I do currently, jsut with the lack of meta data.

If you want to make your own suggestion(s) you can do so on the uservoice [https://twitch.uservoice.com/forums/310213-developers](https://twitch.uservoice.com/forums/310213-developers)

Edit: there is also RFC0011 that I forgot existed

> [@RFC 0011 - Extension Entitlement Service](https://staging-discuss.dev.twitch.com/t/rfc-0011-extension-entitlement-service/19142):
>
> Summary To lower the development time and ongoing costs related to maintaining a Bits-enabled Extension, Twitch is proposing a Twitch-built and managed set of APIs that will be available to any Extension that is Bits-enabled. This proposal has three main goals: Allow Extension developers to more accurately model their product catalog. Remove errors in message passing, giving a greater confidence for all parties involved that users are properly getting the benefits of their digital goods. Redu…

Edit 2: Wrote up my PayPal-esque flow here

> **[PayPal style flow for Bits Transactions](https://twitch.uservoice.com/forums/310213-developers/suggestions/41137525-paypal-style-flow-for-bits-transactions)**
>
> Currently bits transactions only let you be notified of the SKU that was used.
> 
> I would like to see a more "PayPal" model or the bits usage flow.
> 
> Developers would make a POST request to Twitch with the SKU and any meta/extra data for the purchase,...

---

_[View the full topic](https://staging-discuss.dev.twitch.com/t/best-practice-for-network-error-after-bit-transaction/27681)._
