Skip to content

Commit 5cec710

Browse files
authored
updated onboarding steps for EW (#64)
1 parent 798e713 commit 5cec710

File tree

3 files changed

+54
-40
lines changed

3 files changed

+54
-40
lines changed

sdk/headless-wallet/verification.mdx

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@ A common use case is that you authenticate the user on the client, but you want
2020

2121
Once a user has authenticated with an embedded wallet on the client, simply call the corresponding function in order get a JWT from Sequence.
2222
```typescript
23+
// Using Sequence.js
2324
const { idToken } = await sequence.getIdToken();
2425
```
2526

27+
```typescript
28+
// Using Web-SDK in React
29+
const { connector } = useAccount()
30+
31+
const { idToken, expiry } = await connector.sequenceWaas.getIdToken()
32+
```
33+
2634
</Step>
2735
<Step title="Pass JWT to Backend">
2836

@@ -56,8 +64,8 @@ const client = jwksClient({
5664
cacheMaxAge: 86400000, // 1 day
5765
});
5866

59-
// Should be equal to the audience claim in the JWT that you want to verify which will be of the form https://api.sequence.build/project/*projectID*
60-
const EXPECTED_AUDIENCE = "https://api.sequence.build/project/*PROJECT_ID*"
67+
// Should be equal to the audience claim in the JWT that you want to verify which will be of the form https://sequence.build/project/*projectID*
68+
const EXPECTED_AUDIENCE = "https://sequence.build/project/*PROJECT_ID*"
6169
```
6270

6371
</Step>

solutions/builder/embedded-wallet/configuration.mdx

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
---
2-
3-
title: "Embedded Wallet Configuration"
1+
---
2+
3+
title: "Embedded Wallet Configuration"
44
description: Configure a Sequence Embedded Wallet in Builder to easily onboard users to your games by integrating OAuth accounts. Learn how to set up login providers like Google Auth and Apple Auth, specify allowed origins for security, set up a recovery wallet, create an initial configuration.
55
sidebarTitle: Configuration
6-
---
7-
6+
---
7+
88

9-
You can configure a [Sequence Embedded Wallet](/solutions/wallets/embedded-wallet/overview) in Builder and integrate your own OAuth accounts to enable easy onboarding to your games. Configuration page in Builder [is available here](https://sequence.build/project/default/embedded-wallet).
9+
You can configure a [Sequence Embedded Wallet](https://sequence.build/project/default/embedded-wallet?tab=config) in Builder and integrate your own OAuth accounts to enable easy onboarding to your games. Configuration page in Builder [is available here](https://sequence.build/project/default/embedded-wallet).
1010

1111
The following sections will explain the various ways to configure using an Embedded Wallet in Builder:
1212
- [Login Providers](/solutions/builder/embedded-wallet#login-providers): Web2 based authentication providers
@@ -16,11 +16,17 @@ The following sections will explain the various ways to configure using an Embed
1616
- [Configuration Changes](/solutions/builder/embedded-wallet#configuration-changes): Update configuration details at anypoint with password protection
1717
- [SDK Integrations](/solutions/builder/embedded-wallet#sdk-integrations): Sequence SDK products that allow developers to implement an Embedded Wallet across platforms
1818

19+
20+
21+
22+
23+
24+
1925
## Login Providers
20-
Sequence Embedded Wallet supports a multitude of login providers such as email, various social logins, and guest wallets. For social logins, you must go through the configuration process for the provider to retrieve a client specific ID to pass into Sequence Builder. We recommend visiting the specific login provider's configuration page for more information on the setup process.
26+
Sequence Embedded Wallet supports a multitude of login providers such as email, various social logins, and guest wallets. For social logins, you must go through the configuration process for the provider to retrieve a client specific ID to pass into Sequence Builder. We recommend visiting the specific login provider's configuration page for more information on the setup process for each specific provider.
2127

2228
## Allowed Origins
23-
This additional security measure will prevent unauthorized usage of your WaaS configuration outside of domains you whitelisted. Add any development and production URLs under Allowed Origins. By default all subpaths under theses hosts will be allowed.
29+
This additional security measure will prevent unauthorized usage of your embedded wallet configuration outside of domains you whitelisted. Add any development and production URLs under Allowed Origins. By default all subpaths under theses hosts will be allowed.
2430

2531
You must define allowed origins with a valid scheme (i.e. `https`).
2632

solutions/wallets/embedded-wallet/quickstart.mdx

+30-30
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ description: Connect your users to your App with the Sequence Embedded Wallet.
55
sidebarTitle: Quickstart
66
---
77

8-
For Unreal or Unity integration, go to [Unreal](/sdk/unreal/installation) or [Unity](/sdk/unity/installation).
9-
108
## Integrate by Framework
119

1210
<div className="not-prose grid gap-x-4 gap-y-4 sm:grid-cols-2 lg:grid-cols-3 mt-8 mb-8">
@@ -86,47 +84,49 @@ npx sequence-cli boilerplates create-embedded-wallet-react-starter
8684
npx sequence-cli boilerplates create-kit-embedded-wallet-nextjs-starter
8785
```
8886
</CodeGroup>
87+
8988
</Step>
90-
<Step title="Copy example .env file">
9189

92-
```bash
93-
cd embedded-wallet-react-boilerplate && cp .env.example .env
94-
```
90+
<Step title="Connect and Authenticate">
91+
Open your browser and navigate to `http://localhost:4444`. Click on <b>Connect</b> to initiate the authentication process.
92+
93+
You can now test the Embedded wallet with the boilerplate! Now, let's configure your own project.
9594
</Step>
96-
<Step title="Install Packages and start app">
9795

98-
<CodeGroup>
99-
```bash pnpm
100-
pnpm install && pnpm dev
101-
```
96+
<Step title="Configure your Project">
97+
<a href="https://sequence.build/project/default/embedded-wallet?tab=config">Navigate to embedded wallet configuration</a> for your project on Builder. Enter your recovery wallet address and set a password, then <b>Create Configuration</b>. Be aware that this configuration cannot be changed at a later date.
98+
</Step>
10299

103-
```bash npm
104-
npm install && npm run dev
100+
<Step title="Update Environment Variables">
101+
Navigate to the cloned directory and copy & paste this configuration in the file `.env` replacing the existing configuration.
102+
103+
Ensure you update the `PROJECT_ACCESS_KEY` and `WAAS_CONFIG_KEY` with the new keys located on the <a href="https://sequence.build/project/default/embedded-wallet?tab=integration">integration page</a>.
104+
```tsx
105+
# Update with your project access key
106+
VITE_PROJECT_ACCESS_KEY="AQAAAAAAAKJcPk5v95BJE-Q7GwdlY9hPuAM"
107+
# Update with your WAAS_CONFIG_KEY
108+
VITE_WAAS_CONFIG_KEY="eyJwcm9qZWN0SWQiOjQxNTY0LCJycGNTZXJ2ZXIiOiJodHRwczovL3dhYXMuc2VxdWVuY2UuYXBwIn0="
109+
VITE_GOOGLE= NULL
110+
VITE_APPLE= NULL
111+
VITE_WALLET_CONNECT_ID= NULL
112+
VITE_CHAINS= 80002
113+
VITE_DEFAULT_CHAIN= 80002
105114
```
115+
</Step>
106116

107-
```bash yarn
108-
yarn install && yarn dev
109-
```
110-
</CodeGroup>
117+
<Step title="Test your new configuration">
118+
Save your `.env` file, run `pnpm dev` from the root directory, and navigate back to `http://localhost:4444`. Sign into your wallet using email to test the wallet actions again.
111119

112-
</Step>
113-
<Step title="Connect and Authenticate">
114-
Navigate to `localhost:4444` and click connect to try out the authentication.
115-
</Step>
116-
<Step title="Use Sequence Embedded Wallets!">
120+
You are done! You can now see your wallet connection on the Overview page and the keys are scoped to your project.
117121

118-
Now that you have a working authentication, you can take look at our examples for the most common functions:
119-
- [Sign messages](/sdk/headless-wallet/use-wallets#sign-messages)
120-
- [Send transactions](/sdk/headless-wallet/use-wallets#send-transactions)
121-
- [Call contracts](/sdk/headless-wallet/use-wallets#call-any-contract)
122-
- [Verify a user on your backend](/sdk/headless-wallet/verification#prerequisite-deployment-of-a-parent-wallet)
123122
</Step>
124123
</Steps>
125124

125+
As next steps:
126+
- You can now setup various [social authentication providers](/solutions/builder/embedded-wallet#login-providers).
127+
- [Use more features of our web-sdk](/sdk/web/guides/send-sponsored-tx).
128+
- [Request a ID token from Sequence to validate users on your backend](/sdk/headless-wallet/verification).
126129

127-
<Tip>
128-
We are using example variables in the .env file, so we recommend creating a project on [Sequence Builder](https://sequence.build/project/default/wallet/embedded-wallet) and [setting up your own wallet configuration](/solutions/builder/embedded-wallet) and update the environment variables to use more social providers for authentication, customize email templates, and more.
129-
</Tip>
130130

131131

132132

0 commit comments

Comments
 (0)