-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update the docs sidebar to treat RN as a first class citizen
- Loading branch information
Showing
30 changed files
with
242 additions
and
441 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ account-kit/rn-signer/lib/* | |
**/ios/generated/* | ||
**/build/* | ||
**/.cxx/* | ||
|
||
**/vendor/* |
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 @@ | ||
export { RNAlchemySigner } from "./signer.js"; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,12 +17,8 @@ For example code on how to use the Signer in your project, please checkout our e | |
|
||
## Create a Signer Instance | ||
|
||
```tsx | ||
import { RNAlchemySigner } from "@account-kit/react-native-signer"; | ||
|
||
const signer = RNAlchemySigner({ | ||
client: { connection: { apiKey: API_KEY } }, | ||
}); | ||
```ts twoslash | ||
// [!include ~/shared/react-native/signer.ts] | ||
``` | ||
|
||
## Authenticate a User | ||
|
@@ -33,7 +29,9 @@ Next, you'll need to authenticate your user before you can use the Signer as an | |
|
||
To send an email magic link to a user, you can use the `signer.authenticate()` method. | ||
|
||
```tsx | ||
:::code-group | ||
|
||
```ts twoslash [example.ts] | ||
signer | ||
.authenticate({ | ||
email: "[email protected]", | ||
|
@@ -45,6 +43,12 @@ signer | |
}); | ||
``` | ||
|
||
```ts twoslash [signer.ts] filename="signer.ts" | ||
// [!include ~/shared/react-native/signer.ts] | ||
``` | ||
|
||
::: | ||
|
||
### Authenticate User via Deep Link | ||
|
||
When a user clicks on the magic link in their email, it should deep link to your app if this has been setup correctly. | ||
|
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 |
---|---|---|
|
@@ -17,12 +17,8 @@ For example code on how to use the Signer in your project, please checkout our e | |
|
||
## Create a Signer Instance | ||
|
||
```tsx | ||
import { RNAlchemySigner } from "@account-kit/react-native-signer"; | ||
|
||
const signer = RNAlchemySigner({ | ||
client: { connection: { apiKey: API_KEY } }, | ||
}); | ||
```ts twoslash | ||
// [!include ~/shared/react-native/signer.ts] | ||
``` | ||
|
||
## Authenticate a User | ||
|
@@ -33,7 +29,9 @@ Next, you'll need to authenticate your user before you can use the Signer as an | |
|
||
To send an OTP to a user's email, use the `signer.authenticate()` method with the `emailMode` set to `otp`. | ||
|
||
```tsx | ||
:::code-group | ||
|
||
```ts twoslash [example.ts] | ||
signer | ||
.authenticate({ | ||
email: "[email protected]", | ||
|
@@ -45,6 +43,12 @@ signer | |
}); | ||
``` | ||
|
||
```ts twoslash [signer.ts] filename="signer.ts" | ||
// [!include ~/shared/react-native/signer.ts] | ||
``` | ||
|
||
::: | ||
|
||
### Prompt the User to enter the One-Time Password to complete authentication | ||
|
||
The user will receive an email with a one-time password (OTP) to enter into your app. | ||
|
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
44 changes: 44 additions & 0 deletions
44
site/pages/reference/account-kit/react-native/functions/RNAlchemySigner.mdx
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
import { RNAlchemySigner } from "@account-kit/react-native-signer"; | ||
|
||
export const signer = RNAlchemySigner({ | ||
client: { connection: { apiKey: "API_KEY" } }, | ||
// optional param to override session settings | ||
sessionConfig: { | ||
// sets the expiration to 60 minutes | ||
expirationTimeMs: 1000 * 60 * 60, | ||
}, | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.