simialbi / yii2-bexio
Yii2 extension for Bexio API integration
Requires
- php: >=8.2
- giggsey/libphonenumber-for-php: ^9.0
- yiisoft/yii2: ^2.0.54
- yiisoft/yii2-authclient: ^2.2.17
- yiisoft/yii2-httpclient: ^2.0.16
This package is auto-updated.
Last update: 2026-07-31 15:24:17 UTC
README
This extension provides an interface to work with RESTful API from bexio to simplify procces.
Resources
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require --prefer-dist simialbi/yii2-bexio
or add
"simialbi/yii2-bexio": "*"
to the require section of your composer.json.
Configuration
To use this module, configure the module in your application config:
'modules' => [ 'bexio' => [ 'class' => 'simialbi\yii2\bexio\Module', 'clientId' => 'your-client-id', // get on https://developer.bexio.com/ 'clientSecret' => 'your-client-secret', 'scopes' => ['openid', 'profile', 'offline_access', ...] // add application scopes you need here ] ]
See official documentation for additional application scopes.
Be sure you registered your application on https://developer.bexio.com/ and added the [[module_id]]/auth/callback route
as an allowed redirect URL.
Usage
In your controller where you want to use the Bexio API, include the OidcBehavior. This behavior ensures that a user possesses a valid Bexio access token in the session prior to executing a controller action. If the access token is missing, the behavior intercepts the request and redirects the user to an authentication page.
License
yii2-bexio is released under MIT license. See bundled LICENSE for details.