---
title: "RPC: klavffi"
description: "13 entries."
canonical: "https://klav.everdoc.dev/main/reference/rpc/klav_ffi"
channel: "main"
---

# RPC: klav_ffi

> OmarAlex24/klav · channel `main` · main @ [`fe8e2a0c8c24`](https://github.com/OmarAlex24/klav/tree/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92) · 2026-12-05 · generated by Everdoc from source (no LLM).

13 entries.

<a id="rpc-klav_ffi-checkinvite"></a>

## `klav_ffi.checkInvite`

Whether `invite` can be used by `email` on `server` now (`POST /v1/auth/invite/check`, ADR 0048 §1.3): fails with [`KlavError::InviteInvalid`] otherwise. «Continue» runs it before the master password. Not a reservation: [`KlavCore::sign_up`] checks again.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:227](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L227)
- Handlers: 1 · Callers: 5
- Method: `checkInvite` · transport uniffi
- Used at: [apps/ios/Mac/Setup/AccountSheet.swift:67](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L67), [apps/ios/Mac/Setup/AccountSheet.swift:254](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L254), [apps/ios/Mac/Setup/AccountSheet.swift:282](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L282), [apps/ios/Mac/Setup/AccountSheet.swift:323](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L323), [apps/ios/Mac/Setup/AccountSheet.swift:343](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L343)

<a id="rpc-klav_ffi-composedatabaseurl"></a>

## `klav_ffi.composeDatabaseUrl`

Composes a database connection URL exactly as `klav-core` does (ADR 0054 §3); `None` when the parts cannot form one. The composed string can hold the password and is secret.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:141](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L141)
- Handlers: 1 · Callers: 1
- Method: `composeDatabaseUrl` · transport uniffi
- Used at: [apps/ios/Shared/App/ItemDraft.swift:199](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Shared/App/ItemDraft.swift#L199)

<a id="rpc-klav_ffi-coreversion"></a>

## `klav_ffi.coreVersion`

Version of `klav-core` this library is built against.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:109](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L109)
- Handlers: 1 · Callers: 0
- Method: `coreVersion` · transport uniffi

<a id="rpc-klav_ffi-defaultserver"></a>

## `klav_ffi.defaultServer`

The server the app signs in to unless the person opens «Use my own server» (ADR 0028 §2); `None` when `KLAV_NO_DEFAULT_SERVER` is set (the tests).

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:158](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L158)
- Handlers: 1 · Callers: 6
- Method: `defaultServer` · transport uniffi
- Used at: [apps/ios/Klav/DeviceLinkScreens.swift:141](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/DeviceLinkScreens.swift#L141), [apps/ios/Klav/SignInView.swift:15](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/SignInView.swift#L15), [apps/ios/Klav/SignInView.swift:30](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/SignInView.swift#L30), [apps/ios/Mac/Setup/AccountSheet.swift:93](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L93), [apps/ios/Mac/Setup/AccountSheet.swift:126](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L126), … +1

<a id="rpc-klav_ffi-generate"></a>

## `klav_ffi.generate`

A password from the generator (ADR 0022 §1), following the bundled rules of `host` when the type is `smart`.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:251](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L251)
- Handlers: 1 · Callers: 2
- Method: `generate` · transport uniffi
- Used at: [apps/ios/Klav/Generator.swift:226](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/Generator.swift#L226), [apps/ios/Mac/Generator.swift:191](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Generator.swift#L191)

<a id="rpc-klav_ffi-generatepassword"></a>

## `klav_ffi.generatePassword`

A random password (`length` characters; letters and digits, plus symbols when `symbols`).

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:237](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L237)
- Handlers: 1 · Callers: 0
- Method: `generatePassword` · transport uniffi

<a id="rpc-klav_ffi-parsedatabaseurl"></a>

## `klav_ffi.parseDatabaseUrl`

Parses a database connection URL exactly as `klav-core` does (ADR 0054 §3): Postgres, MySQL, Redis, MongoDB and the other engines `klav-core` knows, with percent-decoded user info and path. `None` when the raw text is not one of those URLs. The result holds its password, if any; Swift keeps it only while the paste editor shows it.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:132](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L132)
- Handlers: 1 · Callers: 2
- Method: `parseDatabaseUrl` · transport uniffi
- Used at: [apps/ios/Shared/App/DatabaseRequestWords.swift:16](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Shared/App/DatabaseRequestWords.swift#L16), [apps/ios/Shared/App/ItemDraft.swift:158](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Shared/App/ItemDraft.swift#L158)

<a id="rpc-klav_ffi-proxypresets"></a>

## `klav_ffi.proxyPresets`

The presets of `klav proxy grant --preset`, byte for byte (ADR 0036 §7).

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/proxy_grant.rs:151](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/proxy_grant.rs#L151)
- Handlers: 1 · Callers: 1
- Method: `proxyPresets` · transport uniffi
- Used at: [apps/ios/Mac/Development/ShareCredential.swift:547](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Development/ShareCredential.swift#L547)

<a id="rpc-klav_ffi-registrationmode"></a>

## `klav_ffi.registrationMode`

How `server` takes new accounts (`GET /v1/health`, ADR 0048 §1.2), for «Create your account» before anything is asked: the «Invite code» field follows it, also with «Use my own server». Blocks: call it off the main thread.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:217](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L217)
- Handlers: 1 · Callers: 2
- Method: `registrationMode` · transport uniffi
- Used at: [apps/ios/Mac/Setup/AccountSheet.swift:63](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L63), [apps/ios/Mac/Setup/AccountSheet.swift:311](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L311)

<a id="rpc-klav_ffi-serverfrominput"></a>

## `klav_ffi.serverFromInput`

The server a person typed in «Use my own server»: `https://` added when missing; `klav.dev`, `api.klav.dev` and old URLs of klav.dev mean the default (ADR 0028 §3).

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:166](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L166)
- Handlers: 1 · Callers: 5
- Method: `serverFromInput` · transport uniffi
- Used at: [apps/ios/Klav/AppModel.swift:1410](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/AppModel.swift#L1410), [apps/ios/Klav/DeviceLinkScreens.swift:142](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/DeviceLinkScreens.swift#L142), [apps/ios/Klav/SignInView.swift:31](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/SignInView.swift#L31), [apps/ios/Mac/Setup/AccountSheet.swift:127](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/AccountSheet.swift#L127), [apps/ios/Mac/Setup/SignInWithDevice.swift:41](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Mac/Setup/SignInWithDevice.swift#L41)

<a id="rpc-klav_ffi-servername"></a>

## `klav_ffi.serverName`

How the interface names a server: «klav.dev» for the default, else its host.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:173](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L173)
- Handlers: 1 · Callers: 3
- Method: `serverName` · transport uniffi
- Used at: [apps/ios/Klav/SettingsView.swift:44](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/SettingsView.swift#L44), [apps/ios/Klav/SignInView.swift:169](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/SignInView.swift#L169), [apps/ios/Shared/App/DeviceLinkViews.swift:115](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Shared/App/DeviceLinkViews.swift#L115)

<a id="rpc-klav_ffi-servicehost"></a>

## `klav_ffi.serviceHost`

The host an iOS service identifier stands for: a URL (`https://…`) or a bare domain (`github.com`). Only `https` (or `http` on this device) qualifies, as in the browser extension (ADR 0017 §5).

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:299](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L299)
- Handlers: 1 · Callers: 2
- Method: `serviceHost` · transport uniffi
- Used at: [apps/ios/Credentials/CredentialModel.swift:115](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Credentials/CredentialModel.swift#L115), [apps/ios/Credentials/CredentialModel.swift:296](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Credentials/CredentialModel.swift#L296)

<a id="rpc-klav_ffi-siterelation"></a>

## `klav_ffi.siteRelation`

How the site `host` relates to a login's `urls` (ADR 0025 §3); `None` when the login is not for it at all.

- Kind: rpc
- Workspace: [klav-ffi](../../architecture/klav-ffi.md)
- Source: [crates/klav-ffi/src/lib.rs:314](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/crates/klav-ffi/src/lib.rs#L314)
- Handlers: 1 · Callers: 1
- Method: `siteRelation` · transport uniffi
- Used at: [apps/ios/Klav/AppModel.swift:806](https://github.com/OmarAlex24/klav/blob/fe8e2a0c8c248c44514c31c7f73b89c3f9cafc92/apps/ios/Klav/AppModel.swift#L806)
