putheakhem / laravel-camdigi-key
A Laravel wrapper for the CamDigiKey Node.js client library
Requires
- php: ^8.2
- illuminate/support: ^10.0|^11.0|^12.0
- symfony/process: ^6.0|^7.0|^8.0
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
This package is auto-updated.
Last update: 2026-04-24 04:26:24 UTC
README
Laravel CamDigiKey Package
β οΈ DISCLAIMER: This is an unofficial community package and is not affiliated with, endorsed by, or supported by the official CamDigiKey Platform or the Cambodian government. This package is maintained independently. For official support, please contact the official CamDigiKey Platform directly. A Laravel wrapper for the CamDigiKey Node.js Client.
π°π Stand with Cambodia β’ ααααα»ααΆ
ποΈ Cambodia Needs Peace ποΈ
With heavy hearts, we stand with our brave soldiers defending Cambodiaβs land and dignity. We seek no conflictβonly peace, justice, and respect for our sovereignty.
π ααααα»ααΆααααΌαααΆαααααα·ααΆα β’ Together to protect Cambodiaβs sovereignty.
π¦ Installation
You can install the package via Packagist:
composer require putheakhem/laravel-camdigi-key
βοΈ Setup
After installation:
php artisan vendor:publish --tag=config
This will publish the config/camdigikey.php file.
Run php artisan camdigikey:setup. The package also automatically clones the Node.js SDK into:
vendor/putheakhem/laravel-camdigi-key/node-lib/
For package maintainers using a local symlinked package during development, the SDK resolves from the local package directory.
π .env Configuration
Set your CamDigiKey credentials in .env:
CAMDIGIKEY_CLIENT_ID=your_client_id CAMDIGIKEY_HMAC_KEY=your_hmac_key CAMDIGIKEY_AES_SECRET_KEY=your_aes_secret CAMDIGIKEY_AES_IV_PARAMS=your_iv CAMDIGIKEY_CLIENT_DOMAIN=https://your-app.test CAMDIGIKEY_SERVER_BASED_URL=https://camdigikey.serveo.net CAMDIGIKEY_CLIENT_KEYSTORE_FILE=storage/app/camdigi-key/client_keystore.p12 CAMDIGIKEY_CLIENT_KEYSTORE_FILE_PASSWORD=your_password CAMDIGIKEY_CLIENT_TRUST_STORE_FILE=storage/app/camdigi-key/trust_keystore.p12 CAMDIGIKEY_CLIENT_TRUST_STORE_FILE_PASSWORD=your_password CAMDIGIKEY_REDIRECT_URI=https://your-app.test/callback
β Store
.p12files securely instorage/app/camdigi-key/
π§ͺ Usage
Example route to get a login token:
Route::get('/camdigikey/login-token', function () { return CamDigiKey::getLoginToken(); });
Or in a controller:
$token = CamDigiKey::getLoginToken(); $access = CamDigiKey::getUserAccessToken($authToken);
All supported methods:
getLoginToken()getUserAccessToken($authToken)refreshAccessToken($accessToken)logoutAccessToken($accessToken)validateJwt($accessToken)lookupUserProfile($accessToken, $personalCode)verifyAccountToken($accountToken)getOrganizationAccessToken()getUserFace($accessToken)
π§Ή Artisan Setup Command (Optional)
Automatically run during install:
php artisan camdigikey:setup
This clones the CamDigiKey Node.js SDK into the expected path.
π Security
- Never expose
.p12files in public directories .gitignoreall private keystores- If you discover any security issues, please email puthea.khem at gmail.com instead of using the issue tracker.
Support Me
If you find this package useful, consider supporting my work:
π License
The MIT License (MIT). Please see License File for more information.
Built with β€οΈ by Puthea khem