kangdev/douyin

抖音小程序OpenApi - SDK封装

v1.0.4 2023-04-26 02:49 UTC

This package is auto-updated.

Last update: 2024-04-26 04:47:02 UTC


README

Install

composer require kangdev/douyin -vvv

Usage

<?php
$config = [
    'appid' => 'your-app-id',
    'secret' => 'your-secret',
    'debug' => true,
    'log' => [
        'name' => 'douyin',
        'file' => __DIR__ . '/douyin.log',
        'level' => 'debug',
        'permission' => 0777,
    ],
];

$dispatch = new \KangDev\DouyinDispatch\Dispatch($config);

// getAccessToken
$dispatch->token([
    'grant_type' => 'client_credential',
]);

//code2Session
$code = '';
$dispatch->jscode2session([
    'code'  => $code
]);