-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(sdk): Update passkeys documentation (#649)
- Loading branch information
Showing
4 changed files
with
71 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"createpasskeysigner": "createPasskeySigner" | ||
} |
37 changes: 37 additions & 0 deletions
37
pages/reference-sdk-protocol-kit/passkeys/createpasskeysigner.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters