Skip to content

HasExtensionsMethods ​

php
trait Zairakai\LaravelTwitch\Services\Concerns\HasExtensionsMethods

Twitch Extensions API methods.

Extensions are interactive overlays and panels that enhance the Twitch viewer experience. Note: Most of these endpoints require an Extension Client ID and JWT signed with the extension secret.

Source: src/Services/Concerns/HasExtensionsMethods.php

Methods ​

createExtensionSecret() ​

php
public function createExtensionSecret(string $extensionId, int $delay = 300): array

Create a shared secret for the extension (rotates signing key).

ParameterDescription
$delaySeconds before the previous secret expires (300–900)

Returns array<string, mixed>

getExtension() ​

php
public function getExtension(string $extensionId, string $extensionVersion = null): array

Get the specified extension.

Returns array<string, mixed>

getExtensionBitsProducts() ​

php
public function getExtensionBitsProducts(string $extensionClientId, bool $shouldIncludeAll = false): array

Get the list of Bits products that belongs to the extension.

Returns array<string, mixed>

getExtensionConfigurationSegment() ​

php
public function getExtensionConfigurationSegment(string $extensionId, string $segment, string $broadcasterId = null): array

Get a segment of the extension's configuration (global, broadcaster, or developer).

ParameterDescription
$extensionIdExtension client ID
$segmentglobal, broadcaster, or developer
$broadcasterIdRequired for broadcaster/developer segments

Returns array<string, mixed>

getExtensionLiveChannels() ​

php
public function getExtensionLiveChannels(string $extensionId, int $first = 20, string $after = null): array

Get a list of broadcasters that are streaming live and have installed or activated the extension.

Returns array<string, mixed>

getExtensionSecrets() ​

php
public function getExtensionSecrets(string $extensionId): array

Get the list of secret tokens for the extension.

Returns array<string, mixed>

getReleasedExtension() ​

php
public function getReleasedExtension(string $extensionId, string $extensionVersion = null): array

Get the specified extension's most current version. Released extensions only.

Returns array<string, mixed>

sendExtensionChatMessage() ​

php
public function sendExtensionChatMessage(string $broadcasterId, string $extensionId, string $extensionVersion, string $text): void

Send a chat message to the broadcaster's chat room on behalf of an extension.

sendExtensionPubSubMessage() ​

php
public function sendExtensionPubSubMessage(string $broadcasterId, string $extensionId, string $message, array $targets = ['broadcast']): void

Send a PubSub message to one or more clients listening to the broadcaster's channel.

ParameterDescription
$targetsbroadcast, global, or user IDs

setExtensionConfigurationSegment() ​

php
public function setExtensionConfigurationSegment(string $extensionId, string $segment, string $broadcasterId = null, string $content = null, string $version = null): void

Set a configuration segment for an extension.

ParameterDescription
$extensionIdExtension client ID
$segmentglobal, broadcaster, or developer
$broadcasterIdRequired for broadcaster/developer segments
$contentSerialized JSON string (max 5KB)
$versionConfiguration version for optimistic locking

setExtensionRequiredConfiguration() ​

php
public function setExtensionRequiredConfiguration(string $broadcasterId, string $extensionId, string $extensionVersion, string $configurationVersion): void

Enable activation of a specific extension on the broadcaster's channel.

updateExtensionBitsProduct() ​

php
public function updateExtensionBitsProduct(string $extensionClientId, array $data): array

Add or update a Bits product that the extension created.

ParameterDescription
$dataProduct data (sku, cost, in_development, display_name, etc.)

Returns array<string, mixed>

Documentation of 4.1.4 , built from a03e949 on 4.1.4 by pipeline #2949087255 on 2026-10-11.