JustinLove/elm-twitch-api/7.0.0

Twitch.Helix.User

JSON Decoders for Helix User responses

Use these pieces to pull out the parts your application needs.

import Twitch.Helix.User as User
import Json.Decode exposing (..)


users : Decoder (List User)
users = User.response user


user : Decoder User
user =
  map3 User
    User.id
    User.login
    User.displayName

Field decoders

id : Decoder UserId

Id of the user

login : Decoder String

Login of the user

displayName : Decoder String

Name of the user

userType : Decoder String

Type of the user, e.g. staff

broadcasterType : Decoder String

Broadcaster type of the user, e.g. affiliate/partner

description : Decoder String

User's profile description

profileImageUrl : Decoder String

Profile image url

offlineImageUrl : Decoder String

Channel offline image

viewCount : Decoder Int

Channel view count

email : Decoder (Maybe String)

Users's email, if the request had appropriate scope to read it

createdAt : Decoder Posix

Time account created

Response decoder

response : Decoder a -> Decoder (List a)

Decode individual records from the api response using the specified decoder

Sample Data

sampleUser : String

Sample data for a user