SDKs
PHP SDK
Official PHP client for the MUDBASE API (Composer).
Installation
bash
composer require mudbase/sdkcomposer require mudbase/sdkQuick Start
Construct a Configuration plus the API classes you need - there is no unified client wrapper. Log in first and use the returned JWT as a bearer token; project API keys are not wired into this generated client's request headers yet.
php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use OpenAPI\Client\Configuration;
use OpenAPI\Client\Api\AuthenticationApi;
use OpenAPI\Client\Api\DataApi;
use OpenAPI\Client\Model\LoginRequest;
$config = Configuration::getDefaultConfiguration()
->setHost('https://cloud.mudbase.dev');
$guzzleClient = new GuzzleHttp\Client();
$auth = new AuthenticationApi($guzzleClient, $config);
// Log in an end-user of your project
$session = $auth->loginUser(new LoginRequest(['email' => 'morgan.chen@northwind.dev', 'password' => 'hunter2']));
// Use the returned JWT for subsequent authenticated calls
$config->setAccessToken($session->getToken());
$data = new DataApi($guzzleClient, $config);
// List documents in a collection
$items = $data->listData($projectId, $collectionId);<?php
require_once(__DIR__ . '/vendor/autoload.php');
use OpenAPI\Client\Configuration;
use OpenAPI\Client\Api\AuthenticationApi;
use OpenAPI\Client\Api\DataApi;
use OpenAPI\Client\Model\LoginRequest;
$config = Configuration::getDefaultConfiguration()
->setHost('https://cloud.mudbase.dev');
$guzzleClient = new GuzzleHttp\Client();
$auth = new AuthenticationApi($guzzleClient, $config);
// Log in an end-user of your project
$session = $auth->loginUser(new LoginRequest(['email' => 'morgan.chen@northwind.dev', 'password' => 'hunter2']));
// Use the returned JWT for subsequent authenticated calls
$config->setAccessToken($session->getToken());
$data = new DataApi($guzzleClient, $config);
// List documents in a collection
$items = $data->listData($projectId, $collectionId);More
For error handling, pagination, and other languages, see the SDKs Overview.