1. Go to this page and download the library: Download tokentifyai/usagemeter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tokentifyai / usagemeter example snippets
use UsageMeter\Tokentify;
USAGEMETER_BUCKET from argument
Tokentify::init('your_bucket_name', ['account_id', 'user_id']);
// USAGEMETER_API_KEY and USAGEMETER_BUCKET both from .env
Tokentify::init(getenv('USAGEMETER_BUCKET') ?: 'your_bucket_name', ['account_id', 'user_id']);
// Production (skip health checks after first successful setup)
Tokentify::init(getenv('USAGEMETER_BUCKET') ?: 'your_bucket_name', ['account_id', 'user_id'], [
'verify_connection' => false,
'verify_api_key' => false,
]);
// Not supported — keep the API key in .env only:
// Tokentify::init(['api_key' => 'secret', 'bucket' => 'x', 'tracking_fields' => ['account_id', 'user_id']]);