Pick a backend
HTTP contract
Implement list / folder / upload / rename / move / remove / search on your origin and pass http: { baseUrl } to FileStorageSDK.mount. Full routes and the FileEntry shape are documented in the integration guide.
FileStorageSDK.mount({
el: '#fm',
apiKey: 'fs_live_…',
http: {
baseUrl: 'https://your-app.example/filestorage-proxy',
headers: () => ({ Authorization: 'Bearer ' + token }),
},
})PHP / Laravel / Symfony
There is no separate PHP SDK binary. Load the CDN loader from your template, then proxy storage with a thin controller that speaks the HTTP contract (or the S3 proxy contract if you already use the AWS SDK).
<div id="fm" style="height: 70vh"></div>
<script src="https://cdn.filestorage.io/loader.min.js"></script>
<script>
FileStorageSDK.mount({
el: '#fm',
apiKey: @json(config('services.filestorage.key')),
http: {
baseUrl: @json(url('/filestorage-proxy')),
headers: () => ({ 'X-CSRF-TOKEN': @json(csrf_token()) }),
},
})
</script><div id="fm" style="height: 70vh"></div>
<script src="https://cdn.filestorage.io/loader.min.js"></script>
<script>
FileStorageSDK.mount({
el: '#fm',
apiKey: '{{ filestorage_api_key }}',
http: { baseUrl: "{{ path('filestorage_proxy') }}" },
})
</script>A minimal Laravel controller for the list route, using a Flysystem S3 disk:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class FileStorageController extends Controller
{
public function list(Request $request)
{
$path = trim($request->input('path', '/'), '/');
$disk = Storage::disk('s3');
$folders = collect($disk->directories($path))->map(fn ($dir) => [
'path' => '/' . $dir,
'name' => basename($dir),
'kind' => 'folder',
'updatedAt' => now()->valueOf(),
]);
$files = collect($disk->files($path))->map(fn ($file) => [
'path' => '/' . $file,
'name' => basename($file),
'kind' => 'file',
'size' => $disk->size($file),
'updatedAt' => $disk->lastModified($file) * 1000,
'url' => $disk->url($file),
]);
return ['items' => $folders->concat($files)->values()];
}
}<?php
use App\Http\Controllers\FileStorageController;
Route::middleware('auth')->prefix('filestorage-proxy/api/files')->group(function () {
Route::post('/list', [FileStorageController::class, 'list']);
// folder, upload, rename, move, remove, search …
});Azure Blob & Google Cloud Storage
Keep cloud credentials on the server. From the browser, use the helpers (aliases of HttpFileStore) and point them at a proxy that speaks the HTTP contract:
FileStorageSDK.mount({
el: '#fm',
apiKey: 'fs_live_…',
store: FileStorageSDK.createAzureBlobStore({
baseUrl: 'https://your-app.example/azure-proxy',
}),
})FileStorageSDK.mount({
el: '#fm',
apiKey: 'fs_live_…',
store: FileStorageSDK.createGcsStore({
baseUrl: 'https://your-app.example/gcs-proxy',
}),
})GCS with S3 interoperability (HMAC keys) can also use the S3 proxy and the s3 option.
S3-compatible storage
Cloudflare R2, DigitalOcean Spaces, MinIO, and other S3-compatible services work through the reference S3 proxy - set a custom endpoint and keep using the s3 mount option.
S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
S3_FORCE_PATH_STYLE=1 # required for MinIO
AWS_DEFAULT_REGION=auto
AWS_BUCKET=my-bucket
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=