Skip to content

Commit e35ebb7

Browse files
committed
bump JWT lib
update to helix/pubsub
1 parent dbe14e5 commit e35ebb7

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"firebase/php-jwt": "^6.0"
3+
"firebase/php-jwt": "^7.0"
44
}
55
}

extensions/pubsub/php/composer.lock

Lines changed: 20 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/pubsub/php/send_pubsub_message.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
$secret = base64_decode(EXTENSION_SECRET);
2727

2828
// generate a JWT token
29-
$token = JWT::encode($payload, $secret);
29+
$token = JWT::encode($payload, $secret, 'HS256');
3030

3131
// build curl to make request
32-
$ch = curl_init('https://api.twitch.tv/helix/extensions/message/' . $channel_id);
32+
$ch = curl_init('https://api.twitch.tv/helix/extensions/pubsub');
3333
curl_setopt($ch, CURLOPT_POST, true);
3434
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
3535
curl_setopt($ch, CURLOPT_HEADER, true);
@@ -39,16 +39,15 @@
3939
'Content-Type: application/json'
4040
));
4141
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
42-
'target': array('broadcast'),
43-
'broadcaster_id': $channel_id,
44-
'is_global_broadcast': false,
42+
'target' => array('broadcast'),
43+
'broadcaster_id' => $channel_id,
44+
'is_global_broadcast' => false,
4545
'message' => $message_to_send
4646
)));
4747

4848
// run the request
4949
$resp = curl_exec($ch);
5050
$info = curl_getinfo($ch);
51-
curl_close($ch);
5251

5352
// lets do some basic parsing
5453
$header_size = $info['header_size'];

0 commit comments

Comments
 (0)