Reading a private cache key

Using the official SDK is the recommended way to read a private cache key.

Private Read Request using the SDK

GET
https://{your-project-name}.api.fireboost.io/cache/get/{your-cache-key}
use FireboostIO\SDK\CacheManager;
use FireboostIO\SDK\Adapter\SessionAdapter;

$apiKey = 'your-api-key'; // Or set FIREBOOST_API_KEY environment variable
$cacheManager = new CacheManager(new SessionAdapter(), $apiKey);

$cacheKey = 'your-cache-key';

// Read data from cache
$data = $cacheManager->readCache($cacheKey);

Private Read Request using the libraries

This approach is best suited if you want to build a custom SDK or have more fine‑grained control over your integration.

Once you have the JWT token, set it in the client configuration for further secure API calls:

GET
https://{your-project-name}.api.fireboost.io/cache/get/{your-cache-key}
use FireboostIO\Configuration;
$jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6Ik...';

$config = new Configuration();
$config->setAccessToken($jwt);
$config->setApiKeyPrefix('bearer', 'Bearer');
$api = new FireboostIO\Api\FireboostApi(null, $config);

// Use the client to read a secure endpoint

$response = $api->getCache('your-cache-key');

var_dump(
  $response->getResult()[0]
);

Was this page helpful?