simply-stream/twitch-api-bundle

v0.1.0 2022-12-05 14:44 UTC

This package is auto-updated.

Last update: 2024-09-04 15:38:42 UTC


README

安装

请确保已全局安装 Composer,具体操作请参阅 Composer 文档中的安装章节

使用 Symfony Flex 的应用程序

打开命令行控制台,进入您的项目目录,并执行以下操作

$ composer require simply-stream/twitch-api-bundle

不使用 Symfony Flex 的应用程序

步骤 1:下载 Bundle

打开命令行控制台,进入您的项目目录,并执行以下命令以下载此 Bundle 的最新稳定版本

$ composer require simply-stream/twitch-api-bundle

步骤 2:启用 Bundle

然后,通过将其添加到项目 config/bundles.php 文件中注册的 Bundle 列表中来启用此 Bundle

// config/bundles.php

return [
    // ...
    SimplyStream\TwitchApiBundle\SimplyStreamTwitchApiBundle::class => ['all' => true],
];

配置

以下配置是必需的

    simplystream_twitch_api:
        # See https://dev.twitch.tv/docs/authentication#registration on how to get client id and secret
        twitch_id:     '%env(TWITCH_ID)%'
        twitch_secret: '%env(TWITCH_SECRET)%'
        # The url your user will be redirected to in authentication process
        redirect_uri:  '%env(TWITCH_REDIRECT_URI)%'
        # The secret used in https://dev.twitch.tv/docs/eventsub#subscriptions to validate against manipulation.
        webhook:
            secret: '%env(TWITCH_WEBHOOK_SECRET)%'