@bosunski/laravel-cloud-sdk
v0.1.5
Published
TypeScript client for the Laravel Cloud API
Downloads
133
Maintainers
Readme
Laravel Cloud SDK (TypeScript)
TypeScript client for the Laravel Cloud API, providing convenient wrappers for applications, environments, deployments, domains, database clusters, and instances endpoints.
Getting Started
pnpm install @bosunski/laravel-cloud-sdkimport { LaravelCloudClient } from '@bosunski/laravel-cloud-sdk';
const client = new LaravelCloudClient({ apiToken: process.env.LARAVEL_CLOUD_TOKEN! });
const apps = await client.applications.list();
await client.environments.start('env-123', { redeploy: true });
await client.domains.create('env-123', { name: 'example.com' });
const databases = await client.databases.list({ include: ['schemas'] });
await client.instances.create('env-123', {
name: 'web-1',
type: 'service',
size: 'flex.m-1vcpu-1gb',
scalingType: 'auto',
maxReplicas: 2,
minReplicas: 1,
usesScheduler: true,
});CDN Usage
The package is published as an ES module, so you can load it via a CDN like jsDelivr:
<script type="module">
import { LaravelCloudClient } from 'https://cdn.jsdelivr.net/npm/@bosunski/laravel-cloud-sdk/+esm';
const client = new LaravelCloudClient({ apiToken: 'token' });
const databases = await client.databases.list();
console.log(databases);
</script>Testing
This repository uses Vitest with mocked fetch handlers. Run the full suite with:
pnpm testTo inspect coverage output:
pnpm test -- --coverage