@@ -16,7 +16,7 @@ import {
1616import { CrudEntry } from '../bucket/CrudEntry.js' ;
1717import { SyncDataBucket } from '../bucket/SyncDataBucket.js' ;
1818import { AbstractRemote , FetchStrategy , SyncStreamOptions } from './AbstractRemote.js' ;
19- import { coreStatusToJs , EstablishSyncStream , Instruction , SyncPriorityStatus } from './core-instruction.js' ;
19+ import { EstablishSyncStream , Instruction , coreStatusToJs } from './core-instruction.js' ;
2020import {
2121 BucketRequest ,
2222 CrudUploadNotification ,
@@ -129,6 +129,11 @@ export interface InternalConnectionOptions extends BaseConnectionOptions, Additi
129129
130130/** @internal */
131131export interface BaseConnectionOptions {
132+ /**
133+ * A set of metadata to be included in service logs.
134+ */
135+ appMetadata ?: Record < string , string > ;
136+
132137 /**
133138 * Whether to use a JavaScript implementation to handle received sync lines from the sync
134139 * service, or whether this work should be offloaded to the PowerSync core extension.
@@ -223,6 +228,7 @@ export const DEFAULT_STREAMING_SYNC_OPTIONS = {
223228export type RequiredPowerSyncConnectionOptions = Required < BaseConnectionOptions > ;
224229
225230export const DEFAULT_STREAM_CONNECTION_OPTIONS : RequiredPowerSyncConnectionOptions = {
231+ appMetadata : { } ,
226232 connectionMethod : SyncStreamConnectionMethod . WEB_SOCKET ,
227233 clientImplementation : DEFAULT_SYNC_CLIENT_IMPLEMENTATION ,
228234 fetchStrategy : FetchStrategy . Buffered ,
@@ -699,6 +705,7 @@ The next upload iteration will be delayed.`);
699705 include_checksum : true ,
700706 raw_data : true ,
701707 parameters : resolvedOptions . params ,
708+ app_metadata : resolvedOptions . appMetadata ,
702709 client_id : clientId
703710 }
704711 } ;
@@ -1088,6 +1095,7 @@ The next upload iteration will be delayed.`);
10881095 try {
10891096 const options : any = {
10901097 parameters : resolvedOptions . params ,
1098+ app_metadata : resolvedOptions . appMetadata ,
10911099 active_streams : this . activeStreams ,
10921100 include_defaults : resolvedOptions . includeDefaultStreams
10931101 } ;
0 commit comments