Skip to main content

@powersync/nuxt

PowerSync Nuxt Module - Public API

This module provides PowerSync integration for Nuxt applications with built-in diagnostics and inspector capabilities.

Classes

ClassDescription
NuxtPowerSyncDatabaseAn 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

PropertyTypeDescription
kysely?booleanEnable Kysely integration. When set to true, enables the usePowerSyncKysely composable for type-safe database queries. Requires @powersync/kysely-driver to be installed. Default false
useDiagnostics?booleanEnable diagnostics and the PowerSync Inspector. When set to true, enables diagnostics recording and makes the PowerSync Inspector available. The inspector provides real-time monitoring, data inspection, and debugging tools. Default false

UsePowerSyncInspectorDiagnosticsReturn

Return type of usePowerSyncInspectorDiagnostics. Uses named types so the signature stays readable in docs and IDE.

Properties

PropertyTypeDescription
bucketRowsReadonly<Ref<null | BucketRow[]>>-
clearData() => Promise<void>-
connectionOptionsComputedRef<null | PowerSyncConnectionOptions>-
connectorComputedRef<null | PowerSyncBackendConnector>-
dbundefined | Ref<AbstractPowerSyncDatabase>-
downloadErrorReadonly<Ref<unknown>>-
downloadProgressDetailsReadonly<Ref<unknown>>-
formatBytes(bytes: number, decimals?: number) => string-
hasSyncedReadonly<Ref<boolean>>-
isConnectedReadonly<Ref<boolean>>-
isDiagnosticSchemaSetupReadonly<Ref<boolean>>-
isDownloadingReadonly<Ref<boolean>>-
isSyncingReadonly<Ref<boolean>>-
isUploadingReadonly<Ref<boolean>>-
lastSyncedAtReadonly<Ref<null | Date>>-
syncStatusReadonly<Ref<SyncStatus>>Current sync status. Typed as SyncStatus for a concise doc signature; at runtime it may be a readonly proxy.
tableRowsReadonly<Ref<null | TableRow[]>>-
totalDownloadProgressReadonly<Ref<string>>-
totalsReadonly<Ref<UsePowerSyncInspectorDiagnosticsTotals>>-
uploadErrorReadonly<Ref<unknown>>-
uploadQueueCountReadonly<Ref<number>>-
uploadQueueSizeReadonly<Ref<string>>-
uploadQueueStatsReadonly<Ref<null | UploadQueueStats>>-
userIDReadonly<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

NameType
bucketsnumber
data_sizestring
download_sizestring
downloaded_operationsnumber | undefined
metadata_sizestring
row_countnumber
total_operationsnumber

Functions

FunctionDescription
useDiagnosticsLoggerProvides a logger configured for PowerSync diagnostics.
usePowerSyncInspectorA composable for setting up PowerSync Inspector functionality.
usePowerSyncInspectorDiagnosticsA comprehensive composable that provides real-time diagnostics data and sync status monitoring for your PowerSync client and local database.
usePowerSyncKyselyProvides a Kysely-wrapped PowerSync database for type-safe database queries.