PHP client for the Datalumo API.
composer require datalumo/phpRequires PHP 8.2+.
use Datalumo\Client;
$client = new Client(
token: getenv('DATALUMO_TOKEN'),
organisation: getenv('DATALUMO_ORG'), // organisation public id, not the slug
);
// Confirm the token and list sources
$me = $client->me()->get();
// Push a page (indexing is asynchronous)
$client->pages('docs')->upsert([
'external_id' => 'post-42',
'name' => 'Hello',
'content' => '# Hello',
'content_mime' => 'text/markdown',
'source_url' => 'https://example.com/hello',
]);
// Search via a widget
$result = $client->widgets($widgetId)->search([
'query' => 'how does pricing work',
'limit' => 5,
]);
foreach ($result->data as $hit) {
echo $hit->name;
}Self-hosted:
$client = new Client(
token: $token,
organisation: $orgId,
baseUrl: 'https://your-instance.example',
);- API docs
- Laravel package:
datalumo/laravel