# tauri-plugin-macos-passkey
A Tauri plugin that lets your Tauri app call macOS native Passkey APIs for registration and login, with optional support for returning the Passkey PRF extension output.
## Setup
For detailed setup instructions, see the [tauri-passkey-demo](https://github.com/yminghua/tauri-passkey-demo) repository.
## APIs
### `register_passkey`
#### Signature (frontend via invoke)
```typescript
challenge: number[],
username: string,
userId: number[],
salt: number[] // pass [] to skip PRF
})
```
#### Returns
```typescript
{
id: string,
raw_id: string,
client_data_json: string,
attestation_object: string,
prf_output: number[] // empty if PRF skipped
}
```
### `login_passkey`
#### Signature (frontend via invoke)
```typescript
challenge: number[],
salt: number[] // pass [] to skip PRF
})
```
#### Returns
```typescript
{
id: string,
raw_id: string,
client_data_json: string,
authenticator_data: string,
signature: string,
user_handle: string,
prf_output: number[] // empty if PRF skipped
}
```
## Notes
- **macOS version**: Requires macOS 15 or later.
- **PRF Output**: If you don’t need PRF, pass an empty salt (`[]`) and the plugin will skip the PRF extension.
## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.