View Source TwitchAPI (hello_twitch_api v0.2.0)

Twitch API.

Summary

Types

@type body_params() :: map() | keyword()
@type response() :: {:ok, map() | String.t() | nil} | {:error, term()}

Functions

@spec client(TwitchAPI.Auth.t()) :: Req.Request.t()

Build a base Req.Request.t/0 for Twitch API requests.

Link to this function

create_eventsub_subscription(auth, type, version, transport, condition)

View Source
@spec create_eventsub_subscription(
  TwitchAPI.Auth.t(),
  type :: String.t(),
  version :: String.t(),
  transport :: map(),
  condition :: map()
) :: response()

Create an eventsub subscription using. https://dev.twitch.tv/docs/api/reference/#create-eventsub-subscription

Authorization

  • If you use webhooks to receive events, the request must specify an app access token. The request will fail if you use a user access token.
  • If you use WebSockets to receive events, the request must specify a user access token. The request will fail if you use an app access token. The token may include any scopes.
Link to this function

handle_response(resp, expected_status \\ 200)

View Source
@spec handle_response({:ok, Req.Response.t()} | {:error, term()}, pos_integer()) ::
  response()

Handle the result of a request to Twitch.

Link to this function

list_eventsub_subscriptions(auth, params \\ %{})

View Source
@spec list_eventsub_subscriptions(TwitchAPI.Auth.t(), body_params()) :: response()

List EventSub Subscriptions. https://dev.twitch.tv/docs/api/reference/#get-eventsub-subscriptions

Authorization

  • If you use webhooks to receive events, the request must specify an app access token. The request will fail if you use a user access token.
  • If you use WebSockets to receive events, the request must specify a user access token. The request will fail if you use an app access token. The token may include any scopes.
@spec revoke_token!(TwitchAPI.Auth.t()) :: Req.Response.t()

Revoke an access token.

Link to this function

update_custom_reward(auth, broadcaster_id, reward_id, fields)

View Source
@spec update_custom_reward(
  TwitchAPI.Auth.t(),
  broadcaster_id :: String.t(),
  reward_id :: String.t(),
  body_params()
) :: response()

Update Custom Reward https://dev.twitch.tv/docs/api/reference/#update-custom-reward

Authorization

  • Requires user access token with channel:manage:redemptions scope.