glance-project / shorten-url-service
Abstraction on top of CERN Shorten URL API
Installs: 4 520
Dependents: 0
Suggesters: 0
Security: 0
pkg:composer/glance-project/shorten-url-service
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.0
- php-di/php-di: 6.4
- psr/http-message: ^2.0
Requires (Dev)
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2025-09-24 13:55:07 UTC
README
This is an abstraction on top of the CERN Shorten Url API (https://gitlab.cern.ch/webservices/web-redirector-v2/-/blob/master/app/api/README.md).
Getting started
To use this library, you need to have an application registered on Application Portal. This application need to be able to exchange token with the audience described on the Shorten URL API (https://auth.docs.cern.ch/user-documentation/oidc/exchange-for-api/).
Once your application has the right access to the API, you can use this library.
Usage
Install using composer
composer-require glance-project/shorten-url-serviceStart using to create your short URLs! You can follow the example bellow: :)
use Glance\ShortenUrlService\ShortenUrl\Infrastructure\Provider\ShortenUrlProviderFactory; $provider = ShortenUrlProviderFactory::createProviderFromCredentials( "<your-client-id>", "<your-client-secret>", (bool)"<in-production?>" ); $shortUrl = $provider->createShortUrlFor("<target-url>");