Skip to content

A small sample implementation of drops using client-side device code flow (DCF). Handles authorization, pulling entitlements and fulfilment

Notifications You must be signed in to change notification settings

twitchdev/drops-csharp-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drops C# Client Sample

This is a small sample implementation of Drops using client-side device code flow (DCF). Handles authorization, pulling entitlements and updating the status of those entitlements.

Requirements

  • .NET 6.0 SDK or later
  • Twitch Developer Application and Client ID
  • Twitch Account (for authorization)

Build Instructions

Here are four examples from various build environments.

.Net Command line

Clone this repository and then navigate to the project directory.

#Ensure dependencies before building or running
dotnet restore
dotnet build
dotnet run

Visual Studio Code

  1. Clone this repository and then add that folder to your Visual Studio Code instance.
  2. Right click on TwitchDrops.cdproj
  3. Click Build

Visual Studio

Clone this repository to a folder then:

  1. Open the solution file. (TwitchDrops.slnx)
  2. Right click on the project in the solution explorer.
  3. Select: "Restore NuGet Packages"
  4. Click build. (Or use the hotkey Ctrl+Shift+B)

Standalone application via DotNET

Clone this repository to a folder, then navigate in command line to that folder. Then run this command to build a stand alone executable file:

donet publish -c Release -r win-x64 --self-contained true

The above assumes windows, for other platforms replace win-x64 with:

  • linux: linux-x64
  • macos intel: osx-x64
  • macos apple: osx-arm64

Configuration

If you don't already have a Twitch application:

  1. Go to the Twitch Developer Console
  2. Click "Register your Application"
  3. Enter a unique name for your Applcation
  4. Use http://localhost for the OAuthRedirect URL
  5. Set Category to Game Integration
  6. Select Public as the Client Type
  7. Click Create
  8. Click manage on the application you just made
  9. Copy down the Client ID

If you do have a Twitch application:

  1. Go to the Twitch Developer Console
  2. Click manage on your application
  3. Copy down the Client ID

Usage

Run the application and follow the prompts on screen.

About

A small sample implementation of drops using client-side device code flow (DCF). Handles authorization, pulling entitlements and fulfilment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages