Skip to content

Commit

Permalink
add history sync url
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jun 24, 2024
1 parent f3f0b5a commit dc39445
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/lib/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export class Client<
Boolean(enableSubscription),
Boolean(options.enableV3),
options.dbEncryptionKey,
options.dbDirectory
options.dbDirectory,
options.historySyncUrl
)
})().catch((error) => {
console.error('ERROR in create: ', error)
Expand Down Expand Up @@ -163,7 +164,8 @@ export class Client<
Boolean(enableSubscription),
Boolean(options.enableV3),
options.dbEncryptionKey,
options.dbDirectory
options.dbDirectory,
options.historySyncUrl
)
this.removeSubscription(enableSubscription)
this.removeSubscription(createSubscription)
Expand Down Expand Up @@ -199,7 +201,8 @@ export class Client<
options.appVersion,
Boolean(options.enableV3),
options.dbEncryptionKey,
options.dbDirectory
options.dbDirectory,
options.historySyncUrl
)

return new Client(
Expand Down Expand Up @@ -492,6 +495,10 @@ export type ClientOptions = {
* OPTIONAL specify the XMTP managed database directory
*/
dbDirectory?: string
/**
* OPTIONAL specify a url to sync message history from
*/
historySyncUrl?: string
}

export type KeyType = {
Expand All @@ -510,6 +517,7 @@ export function defaultOptions(opts?: Partial<ClientOptions>): ClientOptions {
enableV3: false,
dbEncryptionKey: undefined,
dbDirectory: undefined,
historySyncUrl: undefined,
}

return { ..._defaultOptions, ...opts } as ClientOptions
Expand Down

0 comments on commit dc39445

Please sign in to comment.