承接 michaelgarrez/twitch-alerts-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

michaelgarrez/twitch-alerts-sdk

Composer 安装命令:

composer require michaelgarrez/twitch-alerts-sdk

包简介

Twitch Alerts SDK

README 文档

README

Scrutinizer Code Quality Build Status SensioLabsInsight

Introduction

This library eases the use of the Twitch Alerts API. The current version is built to work with the v1.0 of Twitch Alerts API.

How to use

You first have to register your application with Twitch Alerts, to do this, go on this URL :

--> Register your application

Then you can use the API Wrapper knowing your client_id, client_secret and redirect_uri parameters.

Twitch API uses OAuth 2.0 to handle user authentication. This library helps you to handle the authentication process as well.

User Authentication

You will first need to instanciate a Client :

<?php

$client = new Client($clientId, $clientSecret, $redirectUri); // $redirectUri should also match exactly the data you entered when you registred your application

You will need to redirect the user to Twitch Alerts when he will accept (or deny) your application to acces his account. You can ask for multiples scopes. Further you will be limited by the scopes you asked on this step. (The list of the available scopes are available in Client::SCOPES .

<?php

$client = new Client($clientId, $clientSecret, $redirectUri);
$redirectUrl = $client->getAuthorizeUrl(['donations.create']); // You can pass multiple scopes here

// You should then need to redirect the user to this URI.
// When the user will return to your redirect_uri either the "code" parameter will be present on the query parameters (you will need it for the next step) or an "error" parameter will be present which means the user refused to allow your application to access his account.

When you have the "code" parameter returned from the previous step will be able to ask for an access_token and a refresh_token. The access_token is needed for any further call you make to the API and the refresh_token is needed to refresh your access_token when it will expire.

To generate your first access_token and refresh_token :

<?php
$client = new Client($clientId, $clientSecret, $redirectUri);
$tokens = $client->getAccessToken($code); // $code is the code returned on the previous step

// $tokens will contains multiple keys : "access_token" and "refresh_token".

You can now use other API methods for 3600 seconds, then you will need to refresh your access token :

<?php
$client = new Client($clientId, $clientSecret, $redirectUri);
$tokens = $client->refreshAccessToken($refreshToken); // $refreshToken is the refreshToken you got from the previous step (or the last refreshAccessToken you did).

// $tokens will contains multiple keys : "access_token" and "refresh_token".

michaelgarrez/twitch-alerts-sdk 适用场景与选型建议

michaelgarrez/twitch-alerts-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 5, 最近一次更新时间为 2016 年 01 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「alerts」 「twitch」 「twitch alerts」 「twitch sdk」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 michaelgarrez/twitch-alerts-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 michaelgarrez/twitch-alerts-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 michaelgarrez/twitch-alerts-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-19