@powersync/nuxt
PowerSync Nuxt Module - Public API
This module provides PowerSync integration for Nuxt applications with built-in diagnostics and inspector capabilities.
Classes
| Class | Description |
|---|---|
| NuxtPowerSyncDatabase | An extended PowerSync database class that includes diagnostic capabilities for use with the PowerSync Inspector. |
Interfaces
PowerSyncNuxtModuleOptions
Configuration options for the PowerSync Nuxt module.
Example
export default defineNuxtConfig({
modules: ['@powersync/nuxt'],
powersync: {
useDiagnostics: true,
},
})
Properties
UsePowerSyncInspectorDiagnosticsReturn
Return type of usePowerSyncInspectorDiagnostics. Uses named types so the signature stays readable in docs and IDE.
Properties
| Property | Type | Description |
|---|---|---|
bucketRows | Readonly<Ref<null | BucketRow[]>> | - |
clearData | () => Promise<void> | - |
connectionOptions | ComputedRef<null | PowerSyncConnectionOptions> | - |
connector | ComputedRef<null | PowerSyncBackendConnector> | - |
db | undefined | Ref<AbstractPowerSyncDatabase> | - |
downloadError | Readonly<Ref<unknown>> | - |
downloadProgressDetails | Readonly<Ref<unknown>> | - |
formatBytes | (bytes: number, decimals?: number) => string | - |
hasSynced | Readonly<Ref<boolean>> | - |
isConnected | Readonly<Ref<boolean>> | - |
isDiagnosticSchemaSetup | Readonly<Ref<boolean>> | - |
isDownloading | Readonly<Ref<boolean>> | - |
isSyncing | Readonly<Ref<boolean>> | - |
isUploading | Readonly<Ref<boolean>> | - |
lastSyncedAt | Readonly<Ref<null | Date>> | - |
syncStatus | Readonly<Ref<SyncStatus>> | Current sync status. Typed as SyncStatus for a concise doc signature; at runtime it may be a readonly proxy. |
tableRows | Readonly<Ref<null | TableRow[]>> | - |
totalDownloadProgress | Readonly<Ref<string>> | - |
totals | Readonly<Ref<UsePowerSyncInspectorDiagnosticsTotals>> | - |
uploadError | Readonly<Ref<unknown>> | - |
uploadQueueCount | Readonly<Ref<number>> | - |
uploadQueueSize | Readonly<Ref<string>> | - |
uploadQueueStats | Readonly<Ref<null | UploadQueueStats>> | - |
userID | Readonly<Ref<null | string>> | - |
Type Aliases
UsePowerSyncInspectorDiagnosticsTotals
type UsePowerSyncInspectorDiagnosticsTotals = {
buckets: number;
data_size: string;
download_size: string;
downloaded_operations: number | undefined;
metadata_size: string;
row_count: number;
total_operations: number;
};
Aggregated statistics from the diagnostics composable.
Type declaration
| Name | Type |
|---|---|
buckets | number |
data_size | string |
download_size | string |
downloaded_operations | number | undefined |
metadata_size | string |
row_count | number |
total_operations | number |
Functions
| Function | Description |
|---|---|
| useDiagnosticsLogger | Provides a logger configured for PowerSync diagnostics. |
| usePowerSyncInspector | A composable for setting up PowerSync Inspector functionality. |
| usePowerSyncInspectorDiagnostics | A comprehensive composable that provides real-time diagnostics data and sync status monitoring for your PowerSync client and local database. |
| usePowerSyncKysely | Provides a Kysely-wrapped PowerSync database for type-safe database queries. |