JWT
If your app uses JWTs for authentication, you can use ZeroDev to seamlessly create a smart wallet for each user. Follow these steps:
- Visit the Dashboard.
- Click on the top-right menu.
- Choose
Authentication Providers
. - Enter your JWKS credentials in the
JWT Wallet
section.
JWKS stands for JSON Web Key Set. It is a standard for representing a set of cryptographic keys, specifically public keys, in a JSON format. These public keys are used to verify the signatures of JWTs in various security and identity protocols, such as OAuth 2.0 and OpenID Connect. If you are unsure how to retrieve your JWKS endpoint, join our Discord and ask.
Currently, integrating with JWTs involves some manual setup on our side. Upon saving your JWKS credentials, we will set up the integration within 24 business hours and email you to confirm. If in doubt, you can get in touch with us on Discord or email support@zerodev.app.
Wagmi
import { JWTWalletConnector } from '@zerodevapp/wagmi'
const jwtConnector = new JWTWalletConnector({options: {
projectId: '<your-project-id>',
jwt: "<your user's JWT token>"
}})
Example:
For each connection, we assign a new userID, which in turn creates a new wallet or address. In a real-life scenario, the userID would remain constant, ensuring that the wallet and address also remain constant.
Full Code (Editable)
Ethers
import { ZeroDevWeb3Auth } from '@zerodevapp/web3auth'
let signer: ZeroDevSigner
const instance = new ZeroDevWeb3Auth(defaultProjectId)
instance.init({onConnect: async () => {
signer = await getZeroDevSigner({
projectId: defaultProjectId,
owner: await getRPCProviderOwner(provider)
})
}})
zeroDevWeb3Auth.connect('jwt', {jwt: '<your-jwt>'})
Example:
For each connection, we assign a new userID, which in turn creates a new wallet or address. In a real-life scenario, the userID would remain constant, ensuring that the wallet and address also remain constant.