Social Raid originated as a hackathon project at TwitchCon 2018. Savinthebees, one of the judges, pitched the concept of extensions that provide tools for viewers help participate in growing a streamer's community. After some lengthy brainstorming and discussion, we eventually came up with the idea of Social Raid. After the hackathon, we refined the idea and were able to publish the extension with guidance from Twitch developers.

So, what does it do?

Social Raid is a panel extension that implements a referral system for Twitch channels. It provides a unique referral link for viewers to use when sharing a stream. The viewer can copy the link or use the integrated Facebook and Twitter share buttons instead. Viewers are awarded points for each person they bring in through the link. We provide an incentive for them to compete with other viewers for referrals by displaying their records on a leaderboard.

Streamers can customize the extension by editing the text of the raid message that viewers can use when they share on social media. There is also an option for streamers to edit a description of available rewards. Should they so choose, they can provide additional incentives for sharing, such as giveaways, or subscriptions to encourage viewers to participate.

How was it built?

Our project was built using ReactJS on the front-end, using an extension sample called 'Bot-Commander' as a boilerplate. We created an entirely serverless back-end to handle all referral requests and leaderboard updates. Each user gets a unique referral link to share with others. This link directs to our AWS Lambda function (through API Gateway) which will process the incoming request, update the respective referee's DynamoDB entry, and redirect them to the proper stream. Another function is responsible for returning leaderboard information given a specific streamer. It allows us to get daily, weekly, and all-time referral counts for their viewers. To finish up, we created Cloudwatch rules to do weekly/daily resets on each streamer's viewers.

Challenges we ran into

As our extension gained popularity, we noticed a spike in AWS billing. Our original method of leaderboard polling was not adequate as it occurred for every viewer. As new streamers joined with larger viewer counts, this began to escalate with bills reaching over $40 per day (oops). The solution was simple, we applied lazy loading on leaderboard data, which resulted in bills with less than $0.50 per day. Another challenge we had to address was the worry of concurrent reads/writes to our database. If two viewers access the same referral link simultaneously, that would result in an inaccurate database write (YouTube view count problem). To solve this, we used atomic writes to assert that only one user is accessing the database at a single moment and the rest would be queued.

Business Prospect

The extension currently exists as a nonprofit service, but we have often considered ideas for monetizing the extension. For instance, bits could be used to unlock additional features for the streamer, such as analytics or color schemes. Points could potentially be incorporated into a browser game, providing additional incentive to share and also provide more opportunities for monetization.

Share this project: