forked from alchemyplatform/aa-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'alchemyplatform:main' into main
- Loading branch information
Showing
32 changed files
with
755 additions
and
20 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
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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This file is autogenerated by inject-version.ts. Any changes will be | ||
// overwritten on commit! | ||
export const VERSION = "3.0.0-alpha.8"; | ||
export const VERSION = "3.0.0-alpha.9"; |
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This file is autogenerated by inject-version.ts. Any changes will be | ||
// overwritten on commit! | ||
export const VERSION = "3.0.0-alpha.5"; | ||
export const VERSION = "3.0.0-alpha.9"; |
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
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
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
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,49 @@ | ||
--- | ||
outline: deep | ||
head: | ||
- - meta | ||
- property: og:title | ||
content: Alchemy Signer • addPasskey | ||
- - meta | ||
- name: description | ||
content: Learn how to use the AlchemySigner.addPasskey method | ||
- - meta | ||
- property: og:description | ||
content: Learn how to use the AlchemySigner.addPasskey method | ||
- - meta | ||
- name: twitter:title | ||
content: Alchemy Signer • addPasskey | ||
- - meta | ||
- name: twitter:description | ||
content: Learn how to use the AlchemySigner.addPasskey method | ||
--- | ||
|
||
# addPasskey | ||
|
||
The `addPasskey` method is used to add a passkey as an auth method to an already logged in user. | ||
|
||
::: warning | ||
This method throws if there is no authenticated user. | ||
::: | ||
|
||
## Usage | ||
|
||
::: code-group | ||
|
||
```ts | ||
import { signer } from "./signer"; | ||
|
||
await signer.addPasskey(); | ||
``` | ||
|
||
<<< @/snippets/signers/alchemy/signer.ts | ||
|
||
::: | ||
|
||
## Returns | ||
|
||
`Promise<string[]>` -- on success returns an array of credential ids | ||
|
||
## Parameters | ||
|
||
`params?: CredentialCreationOptions` -- overrides for the WebAuthn credential creation options. For more info on the `CredentialCreationOptions` interface, see [here](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.credentialcreationoptions.html). |
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,71 @@ | ||
--- | ||
outline: deep | ||
head: | ||
- - meta | ||
- property: og:title | ||
content: Alchemy Signer • authenticate | ||
- - meta | ||
- name: description | ||
content: Learn how to use the AlchemySigner.authenticate method | ||
- - meta | ||
- property: og:description | ||
content: Learn how to use the AlchemySigner.authenticate method | ||
- - meta | ||
- name: twitter:title | ||
content: Alchemy Signer • authenticate | ||
- - meta | ||
- name: twitter:description | ||
content: Learn how to use the AlchemySigner.authenticate method | ||
--- | ||
|
||
# authenticate | ||
|
||
The `authenticate` method is used to authenticate a user with the Alchemy Signer. | ||
|
||
## Usage | ||
|
||
::: code-group | ||
|
||
```ts | ||
import { signer } from "./signer"; | ||
|
||
const bundlePromise = new Promise(async (resolve) => { | ||
// up to you define how you collect the OTP from the user | ||
const otpFromUser = await getOtpFromUser(); | ||
resolve(otpFromUser); | ||
}); | ||
|
||
const user = await signer.authenticate({ | ||
type: "email", | ||
email: "[email protected]", | ||
// the bundle is the OTP that the user will input from their email | ||
bundle: bundlePromise, | ||
}); | ||
``` | ||
|
||
<<< @/snippets/signers/alchemy/signer.ts | ||
|
||
::: | ||
|
||
## Returns | ||
|
||
`Promise<User>` -- on success returns a `User` object representing the authenticated user. | ||
|
||
## Parameters | ||
|
||
`AuthParams` -- an object that contains the following properties: | ||
|
||
```ts | ||
export type AuthParams = | ||
| { type: "email"; email: string; bundle: Promise<string> } | ||
| { | ||
type: "passkey"; | ||
createNew: false; | ||
} | ||
| { | ||
type: "passkey"; | ||
createNew: true; | ||
username: string; | ||
creationOpts?: CredentialCreationOptionOverrides; | ||
}; | ||
``` |
Oops, something went wrong.