Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sdk): Update passkeys documentation #649

Merged
merged 19 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add protocol-kit docs
  • Loading branch information
yagopv committed Dec 2, 2024
commit 90eb2a3ff6e1bd0fdd8c8f3e9c3c96bf65977ddb
3 changes: 2 additions & 1 deletion pages/reference-sdk-protocol-kit/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"messages": "Messages",
"safe-modules": "Safe Modules",
"safe-guards": "Safe Guards",
"fallback-handler": "Fallback Handler"
"fallback-handler": "Fallback Handler",
"passkeys": "Passkeys"
}
3 changes: 3 additions & 0 deletions pages/reference-sdk-protocol-kit/passkeys/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"createpasskeysigner": "createPasskeySigner"
}
37 changes: 37 additions & 0 deletions pages/reference-sdk-protocol-kit/passkeys/createpasskeysigner.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Tabs } from 'nextra/components'

# `createPasskeySigner`

Creates a new passkey signer using a [WebAuthn credential](https://developer.mozilla.org/en-US/docs/Web/API/Credential).

## Usage

```typescript
const rpcUrl = "https://..."
const credential = window.navigator.credentials.create({ ... })

const passkeySigner = await Safe.createPasskeySigner(credential)

const protocolKit = await Safe.init({
provider: rpcURL,
signer: passkeySigner,
safeAddress
})
```

## Parameters

### `credential`

- **Type**: `Credential`

The WebAuthn credential to use for signing.

## Returns

`Promise<Pick<PasskeyArgType, 'rawId' | 'coordinates'>>`

An object containing the passkey signer that should be stored securely containing:

- `rawId`: The `rawId` of the credential.
- `coordinates`: The coordinates of the credential. The coordinates are used to sign using Safe smart contracts
Loading
Loading