Skip to content

Commit dd18c61

Browse files
authored
feat(deps): upgrade Capsule SDK dependencies (#2315)
* chore: bump capsule version and update readme * chore: fix versioning to alpha tag
1 parent 3bb50b0 commit dd18c61

File tree

6 files changed

+325
-179
lines changed

6 files changed

+325
-179
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@safe-global/safe-apps-sdk": "^8.1.0",
5555
"@web3-onboard/bitget": "^2.1.1",
5656
"@web3-onboard/blocto": "^2.1.1",
57-
"@web3-onboard/capsule": "^2.3.0",
57+
"@web3-onboard/capsule": "^2.4.0-alpha.1",
5858
"@web3-onboard/cede-store": "^2.3.1",
5959
"@web3-onboard/coinbase": "^2.3.1",
6060
"@web3-onboard/core": "^2.23.0",

packages/capsule/README.md

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,87 @@
11
# @web3-onboard/capsule
22

3-
## Wallet module for connecting Capsule Embedded Wallets to web3-onboard
3+
## Wallet module for connecting Capsule Embedded Wallets to Web3-Onboard
44

5-
[Capsule](https://usecapsule.com/) is a signing solution that you can use to create secure embedded MPC wallets to onboard your users with just an email or social login. Capsule wallets are recoverable, portable, and permissioned across different crypto applications, so your users don't need to create different signers or contract accounts for every app they use
5+
[Capsule](https://usecapsule.com/) is a signing solution that enables you to create secure embedded MPC wallets, allowing users to onboard with just an email or social login. Capsule wallets are recoverable, portable, and permissioned across different crypto applications, eliminating the need for users to create separate signers or contract accounts for each app.
66

7-
If you'd like to use Capsule's full functionality within the web3onboard package without any extra integration steps, you can also [request a Capsule API Key](https://usecapsule.com/api) and use it with this package.
7+
### Getting Started
88

9-
To learn more, check out the [Capsule Developer Docs](https://docs.usecapsule.com/)
9+
1. Visit the [Capsule Developer Portal](https://developer.usecapsule.com)
10+
2. Create a new project
11+
3. Generate an API key for your project
12+
4. Configure your project settings and environments
1013

11-
### Install
14+
### Installation
1215

1316
```bash
14-
yarn add @web3-onboard/capsule
15-
# OR
17+
# Using npm
1618
npm install @web3-onboard/capsule
17-
# OR
19+
20+
# Using yarn
21+
yarn add @web3-onboard/capsule
22+
23+
# Using pnpm
1824
pnpm install @web3-onboard/capsule
25+
26+
# Using bun
27+
bun add @web3-onboard/capsule
1928
```
2029

21-
## Options
22-
For configuration options, check out the [Integration Guide Docs](https://docs.usecapsule.com/integration-guide)
30+
## Configuration Options
2331

2432
```typescript
25-
type CapsuleInitOptions = {
26-
environment: string
33+
export type CapsuleInitOptions = {
34+
// The environment to connect to (PROD or BETA)
35+
environment: Environment
36+
37+
// Your Capsule API key from the developer portal
2738
apiKey: string
28-
/** @optional capsule object opts */
29-
constructorOpts?: ConstructorOpts
30-
appName: string
31-
/** @optional capsule modal props */
32-
modalProps?: CapsuleModalProps
39+
40+
// Optional: Additional constructor options for the Capsule client
41+
constructorOpts?: Partial<ConstructorOpts>
42+
43+
// Optional: Customization props for the Capsule modal
44+
modalProps?: Partial<CapsuleModalProps>
45+
46+
// Optional: Custom function to load wallet icon
47+
walletIcon?: () => Promise<string>
48+
49+
// Optional: Custom label for the wallet
50+
walletLabel?: string
3351
}
3452
```
35-
## Usage
53+
54+
## Implementation
55+
3656
```typescript
3757
import Onboard from '@web3-onboard/core'
38-
import Capsule, { Environment } from '@usecapsule/react-sdk';
58+
import Capsule, { Environment } from '@usecapsule/react-sdk'
3959
import capsuleModule from '@web3-onboard/capsule'
4060

41-
// initialize capsule
61+
// Initialize Capsule client
4262
const capsule = new Capsule(
43-
Environment.BETA, // for production, use ENVIRONMENT.PROD
44-
"YOUR_API_KEY"
45-
{ opts } // find these at docs.usecapsule.com
46-
);
63+
Environment.BETA, // Use Environment.PROD for production
64+
'YOUR_API_KEY' // Your API key from developer.usecapsule.com
65+
)
4766

48-
// initialize the module with options
67+
// Initialize the Capsule module
4968
const capsuleWallet = capsuleModule(capsule)
5069

70+
// Initialize web3-onboard
5171
const onboard = Onboard({
5272
// ... other Onboard options
5373
wallets: [
54-
capsule
74+
capsuleWallet
5575
//... other wallets
5676
]
5777
})
5878

79+
// Connect wallet
5980
const connectedWallets = await onboard.connectWallet()
6081
console.log(connectedWallets)
6182
```
6283

63-
## Build env settings (webpack config)
84+
## Additional Resources
6485

65-
You may need to add the following rule to your webpack config module
66-
in order to handle certain styling files (See the config for the
67-
Blocknative demo app):
68-
69-
```typescript
70-
{
71-
test: /\.(woff(2)?|eot|ttf|otf|svg)$/,
72-
type: 'asset/resource',
73-
generator: {
74-
filename: 'fonts/[name][ext][query]'
75-
}
76-
}
77-
```
86+
- [Capsule Documentation](https://docs.usecapsule.com/)
87+
- [Developer Portal](https://developer.usecapsule.com)

packages/capsule/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/capsule",
3-
"version": "2.3.0",
3+
"version": "2.4.0-alpha.1",
44
"description": "Capsule SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"module": "dist/index.js",
66
"browser": "dist/index.js",
@@ -57,8 +57,8 @@
5757
],
5858
"dependencies": {
5959
"@tanstack/react-query": "^5.29.0",
60-
"@usecapsule/react-sdk": "^3.17.0",
61-
"@usecapsule/wagmi-v2-integration": "^2.18.0",
60+
"@usecapsule/react-sdk": "4.10.0",
61+
"@usecapsule/wagmi-v2-integration": "3.10.0",
6262
"@wagmi/chains": "^1.8.0",
6363
"@web3-onboard/common": "^2.4.1",
6464
"react-dom": "^18.2.0",

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@web3-onboard/bitget": "2.1.1",
3333
"@web3-onboard/blocto": "^2.1.1",
3434
"@web3-onboard/bloom": "2.0.0",
35-
"@web3-onboard/capsule": "^2.3.0",
35+
"@web3-onboard/capsule": "^2.4.0-alpha.1",
3636
"@web3-onboard/cede-store": "^2.3.1",
3737
"@web3-onboard/core": "2.23.0",
3838
"@web3-onboard/coinbase": "^2.4.1",

packages/demo/src/App.svelte

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
import finoaConnectModule from '@web3-onboard/finoaconnect'
4242
import keplrModule from '@web3-onboard/keplr'
4343
import capsuleModule, {
44-
Environment,
45-
OAuthMethod
44+
Environment as CapsuleEnvironment,
45+
OAuthMethod as CapsuleOAuthMethods
4646
} from '@web3-onboard/capsule'
4747
import {
4848
recoverAddress,
@@ -276,16 +276,16 @@
276276
environment: 'staging'
277277
})
278278
const capsule = capsuleModule({
279-
environment: Environment.DEVELOPMENT,
279+
environment: CapsuleEnvironment.DEVELOPMENT,
280280
apiKey: '992bbd9146d5de8ad0419f141d9a7ca7',
281281
modalProps: {
282-
oAuthMethods: [OAuthMethod.GOOGLE, OAuthMethod.TWITTER, OAuthMethod.APPLE,OAuthMethod.DISCORD]
282+
appName: 'Capsule',
283+
disableEmailLogin: false,
284+
disablePhoneLogin: false,
285+
oAuthMethods: Object.values(CapsuleOAuthMethods)
283286
},
284-
constructorOpts: {
285-
portalBackgroundColor: '#5e5656',
286-
portalPrimaryButtonColor: '#ff6700',
287-
portalTextColor: '#ffffff'
288-
}
287+
288+
walletLabel: 'Capsule'
289289
})
290290
291291
const onboard = Onboard({

0 commit comments

Comments
 (0)