TwurpleAuthenticationGetting dataExamplesFAQMigration

TwitchApiCallOptions

Configuration for a single API call.

{
Whether OAuth credentials should be generated and sent with the request. Defaults to `true`.
auth?: boolean
The JSON body to send with the API call.
jsonBody?: unknown
The HTTP method to use. Defaults to `'GET'`.
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
The query parameters to send with the API call.
query?: Record<string, string | string[] | undefined>
The list of scopes that can be used by the request.
scopes?: string[]
The endpoint to call, i.e. /helix or a custom (potentially unsupported) endpoint.
type?:
TwitchApiCallType

The endpoint to call, i.e. /helix or a custom (potentially unsupported) endpoint.

Aliased type: "helix" | "auth" | "custom"

The URL to request.
url: string
}

Properties

auth

Type: ?boolean

Whether OAuth credentials should be generated and sent with the request. Defaults to true.

jsonBody

Type: ?unknown

The JSON body to send with the API call.

If body is also given, this will be ignored.

method

Value: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"

The HTTP method to use. Defaults to 'GET'.

query

Type: ?Record<string, string | string[] | undefined>

The query parameters to send with the API call.

scopes

Type: ?string[]

The list of scopes that can be used by the request.

type

Type:
TwitchApiCallType

The endpoint to call, i.e. /helix or a custom (potentially unsupported) endpoint.

Aliased type: "helix" | "auth" | "custom"

The endpoint to call, i.e. /helix or a custom (potentially unsupported) endpoint.

url

Type: string

The URL to request.

If type is not 'custom', this is relative to the respective API root endpoint. Otherwise, it is an absoulte URL.