diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-09-14 12:47:21 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-09-14 12:47:21 +0000 |
| commit | 783f72cb91b436e8ee6d7349da4cf72dc3219aa1 (patch) | |
| tree | 562a6cd35ed0b7474e25b7ac10f0bd1fef28c8dd /apps/cli/src/lib | |
| parent | 92e357f141ff2aa4730e4a6ec316b7524fec863a (diff) | |
| download | karakeep-783f72cb91b436e8ee6d7349da4cf72dc3219aa1.tar.zst | |
feat: Add scripts to migrate all content from one server to the other
Diffstat (limited to 'apps/cli/src/lib')
| -rw-r--r-- | apps/cli/src/lib/trpc.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/cli/src/lib/trpc.ts b/apps/cli/src/lib/trpc.ts index e6c5555d..deb5c392 100644 --- a/apps/cli/src/lib/trpc.ts +++ b/apps/cli/src/lib/trpc.ts @@ -21,3 +21,20 @@ export function getAPIClient() { ], }); } + +export function getAPIClientFor(opts: { serverAddr: string; apiKey: string }) { + return createTRPCClient<AppRouter>({ + links: [ + httpBatchLink({ + url: `${opts.serverAddr}/api/trpc`, + maxURLLength: 14000, + transformer: superjson, + headers() { + return { + authorization: `Bearer ${opts.apiKey}`, + }; + }, + }), + ], + }); +} |
