bc-automotive / master-api-client
bFlash Master Api Client
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
pkg:composer/bc-automotive/master-api-client
Requires
- guzzlehttp/guzzle: ^7.3
Requires (Dev)
- orchestra/testbench: ^6.18
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2025-10-26 11:50:15 UTC
README
The bc-automotive/master-api-client package is a library that eases integration of the bFlash Master API in your site.
Installation
Install the package via composer:
composer require bc-automotive/master-api-client
Usage
The api uses authentication using a bearer token. Contact bFlash support to request your authentication token.
Encrypt a slave file:
use \BcAutomotive\MasterApiClient\MasterApiClient; $client = new MasterApiClient($apiKey); $data = file_get_contents('/path/to/data.bdc'); $encrypted = $client->encrypt($data, $slaveName); file_put_contents('/path/to/data.sbdc', $encrypted['data']);
Decrypt a slave file:
use \BcAutomotive\MasterApiClient\MasterApiClient; $client = new MasterApiClient($apiKey); $data = file_get_contents('/path/to/data.sbdc'); $decrypted = $client->decrypt($data); file_put_contents('/path/to/data.sbdc', $decrypted['data']);
Laravel Integration
The package has a laravel service provider and facade to ease integration, so after including the package inside your laravel project, you can add the key to the .env file
MASTER_API_KEY=your_key_here
And use the facade:
use MasterApiClient; $encrypted = MasterApiClient::encrypt($data, $slaveName); $decrypted = MasterApiClient::decrypt($data);
Exceptions
The MasterApiClient class is a small wrapper around the Guzzle http client library, so this class can throw all
regular Guzzle exceptions as well. You can file the Guzzle docs here.