@powersync/management-client
v0.1.0
Published
A TypeScript client for the PowerSync Management Service API
Keywords
Readme
@powersync/management-client
TypeScript client SDK for managing PowerSync instances and interacting with the PowerSync Management API.
Note This package is intended for internal usage. Use the PowerSync CLI or Dashboard to manage cloud PowerSync instances.
Installation
npm install @powersync/management-client
# or
pnpm add @powersync/management-client
# or
yarn add @powersync/management-clientUsage
import { PowerSyncManagementClient } from '@powersync/management-client';
import * as sdk from '@journeyapps-labs/common-sdk';
// Create the management client
const client = new PowerSyncManagementClient({
client: sdk.createNodeNetworkClient({
headers: () => ({
Authorization: 'Bearer your-token-here'
})
}),
endpoint: 'https://powersync-api.journeyapps.com'
});
// List all instances
const instances = await client.listInstances({
org_id: 'org-123',
app_id: 'app-456'
});
// Create a new instance
const newInstance = await client.createInstance({
org_id: 'org-123',
app_id: 'app-456',
name: 'my-instance',
region: 'us'
});
// Deploy an instance
const deployment = await client.deployInstance({
org_id: 'org-123',
app_id: 'app-456',
id: 'instance-789',
name: 'my-instance',
config: {
region: 'us',
replication: {
connections: [
/* connection config */
]
}
},
sync_rules: '[Sync rules]',
program_version: {
channel: 'stable',
version_range: '^1.0.0'
}
});Features
Instance Management
- List, create, deploy, and destroy PowerSync instances
- Get instance configuration and status
- Deactivate instances
- Compact instances
Development Tools
- Test database connections
- Get instance schema
- Execute SQL queries
- Validate and reprocess sync rules
- Generate development tokens
Reporting & Analytics
- Get client connection reports
- Get currently connected clients
- Get general client connection analytics with pagination
General Operations
- List available regions
- List available program versions
Dependencies
@journeyapps-labs/common-sdk- Base SDK client functionality@powersync/management-types- Type definitions and route definitions
License
FSL-1.1-ALv2
