Hey folks! I’m hoping that the Twitch devs monitor this board because I have a sneaky little suggestion.
We are gamedevs and partnered streamers and we offer in-game content to players that are subscribed to our channel. Currently we can check if a player is subscribed or not, but we’d like to see how long they’ve been subscribed for. Considering this data is already stored Twitch-side, I assume this implementation shouldn’t be too outrageously difficult?
This will allow us with the ability to provide differing tiers of rewards based on how long they’ve been subbed.
If a user unsubscribes and then resubscribes, the created_at value of a subscription resets. The initial date is only available through the subscriptions page on Twitch as an authenticated user and thus not available through normal means.
However, you are probably right, this is performing an authentication for myself to check my own data. Seems odd that this would be different than the record that is returned from the channel subscription call. Odd but we know the API is odd
I think this is something kind of important in the subscription data but in the meantime you only have bad solutions that can fix your problem but also give you wrong info.
That’s why I’ve been waiting before implementing anything with subscription duration.
Personally, I handle this situation by verifying the created_at leaf and creating a window for re-subscriptions even after twitch’s system disconnects it.
Long story short, temp store and verify the leaf on the due date and for a week after (i do it every 24 hours anyway irrelevant of the timestamp). If they resub during twitches window it won’t change within that week, if it does then you can just “perma” store the original and link them in your application. Some may consider it “hacky” but it works fine and doesn’t require anything from a third party.