https://github.com/shapintv/vimeo
A Vimeo PHP Client
https://github.com/shapintv/vimeo
sdk sdk-php vimeo vimeo-api
Last synced: 3 months ago
JSON representation
A Vimeo PHP Client
- Host: GitHub
- URL: https://github.com/shapintv/vimeo
- Owner: shapintv
- License: mit
- Created: 2020-02-03T14:10:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-09T13:53:30.000Z (over 6 years ago)
- Last Synced: 2026-01-03T04:15:10.885Z (6 months ago)
- Topics: sdk, sdk-php, vimeo, vimeo-api
- Language: PHP
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Vimeo PHP SDK
[](https://github.com/shapintv/vimeo/releases)
[](https://travis-ci.com/shapintv/vimeo)
[](https://packagist.org/packages/shapin/vimeo)
## Install
Via Composer
``` bash
composer require shapintv/vimeo
```
## Usage
### Create a `VimeoClient`
```php
use Shapin\Vimeo\VimeoClient;
use Symfony\Component\HttpClient\HttpClient;
$httpClient = HttpClient::create([
'base_uri' => 'https://api.vimeo.com/',
'auth_bearer' => self::VIMEO_TOKEN,
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/vnd.vimeo.*+json;version=3.4',
],
]);
$client = new VimeoClient($httpClient);
```
### Deal with videos
```php
// Get a video
$video = $client->videos()->get(362164795);
```
### Integration with symfony
Create a new HttpClient:
```yml
framework:
http_client:
scoped_clients:
vimeo.client:
base_uri: 'https://api.vimeo.com/'
auth_bearer: '%env(VIMEO_TOKEN)%'
headers:
'Content-Type': 'application/json'
'Accept': 'application/vnd.vimeo.*+json;version=3.4'
```
Then create your service:
```yml
services:
Shapin\Vimeo\VimeoClient: ['@vimeo.client', ~]
```
When do not use autowiring here in order to avoid the injection of the default `Serializer` if you have one.
This SDK directly build its own `Serializer` when none is passed which is fine for most use cases.
One day, I may consider creating a bundle in order to bootstrap this SDK...
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.