Official PHP client library for the Rasepi API — a multilingual-first collaborative documentation platform with forced expiry and plugin architecture.
composer require rasepihq/rasepi-phpuse Rasepi\RasepiClient;
$client = new RasepiClient([
'base_url' => 'https://your-instance.rasepi.com',
'access_token' => 'your-access-token',
]);
// List hubs
$hubs = $client->hubs()->list();
foreach ($hubs as $hub) {
echo "{$hub['name']} ({$hub['key']})\n";
}
// Get an entry
$entry = $client->entries()->get($entryId);
echo $entry['title'];
// Create a new entry
$newEntry = $client->entries()->create([
'hubKey' => 'engineering',
'key' => 'getting-started',
'title' => 'Getting Started Guide',
'content' => '<p>Hello world</p>',
'originalLanguage' => 'en',
'expiryDays' => 90,
]);$client = new RasepiClient(['base_url' => 'https://your-instance.rasepi.com']);
// Step 1: Get the OAuth login URL
$loginUrl = $client->auth()->getLoginUrl('google', 'https://your-app.com/callback');
// Step 2: After user completes OAuth, exchange the code
$tokens = $client->auth()->exchangeCode($authCode);
// Client automatically stores and uses the tokens
// Tokens are refreshed automatically when expired$tokens = $client->auth()->refreshToken($refreshToken);$client = new RasepiClient([
'base_url' => 'http://localhost:5000',
'dev_token' => ['tenant_id' => $tenantId, 'user_id' => $userId],
]);$client->hubs()->list();
$client->hubs()->get('engineering');
$client->hubs()->create(['key' => 'eng', 'name' => 'Engineering', 'defaultExpiryDays' => 90]);
$client->hubs()->update('engineering', ['name' => 'Engineering Docs']);
$client->hubs()->delete('engineering');
$client->hubs()->transferOwnership('engineering', $newOwnerId);$client->entries()->listByHub('engineering');
$client->entries()->get($entryId);
$client->entries()->create([...]);
$client->entries()->update($entryId, ['title' => 'Updated']);
$client->entries()->publish($entryId);
$client->entries()->renew($entryId);
$client->entries()->delete($entryId);$client->translations()->list($entryId);
$client->translations()->get($entryId, 'de');
$client->translations()->create($entryId, 'de', ['title' => 'Titel', 'content' => '<p>Inhalt</p>']);
$client->translations()->getStatus($entryId, 'de');
$client->translations()->getStaleBlocks($entryId, 'de');
$client->translations()->markUpToDate($entryId, 'de');$client->analytics()->getSummary($entryId);
$client->analytics()->getEvents($entryId, ['skip' => 0, 'take' => 50]);
$client->analytics()->reportTimeSpent($entryId, 120);$results = $client->ai()->search(['query' => 'how to deploy', 'mode' => 'hybrid']);
$conversation = $client->ai()->createConversation('My Question');
$response = $client->ai()->sendMessage($conversationId, ['content' => 'How to set up CI/CD?']);$client->portal()->getFeed();
$client->portal()->getTopics();
$client->portal()->getContent('engineering', 'getting-started', 'en');
$client->portal()->search('deployment guide');$link = $client->sharing()->create('getting-started', ['expiresAt' => '2026-04-14T00:00:00Z']);
$links = $client->sharing()->list('getting-started');
$client->sharing()->revoke('getting-started', $linkId);use Rasepi\Exceptions\RasepiApiException;
try {
$hub = $client->hubs()->get('non-existent');
} catch (RasepiApiException $e) {
echo "Error {$e->getStatusCode()}: {$e->getMessage()}\n";
}- PHP 8.2+
- ext-json
- Guzzle HTTP 7.x
MIT — see LICENSE for details.