CONNECT APP
Build with Twitch
Entertainment
- OAuth
MCP
Give your agent Twitch tools
Every Twitch action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Twitch account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "twitch",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Block User:
const result = await mcp.callTool({
name: "twitch-block-user",
arguments: {
user: "User",
sourceContext: "Source Context",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "twitch",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Block User:
result = await session.call_tool("twitch-block-user", {
"user": "User",
"sourceContext": "Source Context",
})API PROXY
Call the Twitch API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Twitch API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.twitch.tv/helix/users",
})
// Any allowed Twitch endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.twitch.tv/helix/users
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkudHdpdGNoLnR2L2hlbGl4L3VzZXJz?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Twitch actions from your backend
Connect a user's Twitch account once, then run Block User on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "twitch-block-user",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
twitch: { authProvisionId: "apn_xxxxxxx" },
user: "User",
sourceContext: "Source Context",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="twitch-block-user",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"twitch": {"authProvisionId": "apn_xxxxxxx"},
"user": "User",
"sourceContext": "Source Context",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "twitch-block-user",
"configured_props": {
"twitch": { "authProvisionId": "apn_xxxxxxx" },
"user": "User",
"sourceContext": "Source Context"
}
}'TOOLS
Twitch actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Block User
actionBlocks the specified user. See the documentationWritev0.2.1 -
Check Channel Subscription
actionChecks if you are subscribed to the specified broadcaster's channel. See the documentationRead-onlyv0.2.1 -
Delete Video
actionDeletes a specified videoWritev0.1.5 -
Get Channel Editors
actionGets a list of users who are editors for your channelRead-onlyv0.1.5 -
Get Channel Followers
actionRetrieves a list of users who follow the authenticated user. See the documentationRead-onlyv0.0.4 -
Get Channel Information
actionRetrieves information about a particular broadcaster's channelRead-onlyv0.1.5 -
Get Channel Teams
actionGets a list of teams to which a specified channel belongsRead-onlyv0.1.5 -
Get Clips
actionGets clip information by clip ID, user ID, or game IDRead-onlyv0.1.6 -
Get Followed Channels
actionRetrieves a list of channels that the authenticated user follows. See the documentationRead-onlyv0.1.5 -
Get Stream By User
actionGets stream information for the specified user. See the documentationRead-onlyv0.2.1 -
Get Top Games
actionGets games sorted by number of current viewers on Twitch, most popular firstRead-onlyv0.1.5 -
Get Users
actionGets the user objects for the specified Twitch login namesRead-onlyv0.1.5 -
Get Videos
actionGets video information by video ID, user ID, or game ID. See the documentationRead-onlyv0.2.1 -
Search Channels
actionReturns a list of channels (users who have streamed within the past 6 months) that match the query via channel name or description either entirely or partially. Results include both live and offline channels.Read-onlyv0.1.6 -
Search Games
actionSearches for games based on a specified query parameter. A game is returned if the query parameter is matched entirely or partially in the channel description or game nameRead-onlyv0.1.5 -
Unblock User
actionUnblocks the specified user. See the documentationWritev0.2.1 -
Update Channel
actionUpdate information for the channel owned by the authenticated user. At least one parameter must be provided.Writev0.1.6
-
New Clip By Streamer
triggerEmit new event when there is a new clip for the specified streamer.v0.1.4 -
New Clips
triggerEmit new event when there is a new clip for the specified game.v0.1.4 -
New Followed Streams
triggerEmit new event when a followed stream is live.v0.1.4 -
New Follower
triggerEmit new event when a new user follows your channel.v0.1.4 -
New Streams By Game
triggerEmit new event when a live stream starts from any stream matching the game and language specified.v0.1.4 -
New Streams By Streamer
triggerEmit new event when a live stream starts from the streamers you specify.v0.1.4 -
New Subscriber
triggerEmit new event when a new user subscribes to your channel.v0.1.3 -
New Videos
triggerEmit new event when there is a new video from channels you follow.v0.1.4
MULTI-APP
Use Twitch with other popular apps
Most products don't stop at one integration. Pair Twitch with the other apps your users rely on, and ship use cases that span both.
- App slug
- twitch
- Authentication
- OAuth
- Categories
- Entertainment
- Actions
- 17
- Triggers
- 8
- API proxy
- Available
OAuth scopes
These are the scopes Pipedream's managed Twitch OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.
- analytics:read:extensions
- analytics:read:games
- bits:read
- channel:read:subscriptions
- clips:edit
- user:edit
- user:edit:broadcast
- user:read:broadcast
- user:read:email
- user:read:follows
- user:read:blocked_users
- user:manage:blocked_users
- moderator:read:followers
- channel:read:editors
- channel:manage:videos
- user:read:subscriptions