The recommended way to authenticate users is by using Wallet Authentication. This provides your app with access to a User
object that contains the user’s wallet address, username, and other information.
Copy
Ask AI
export type User = { walletAddress?: string username?: string profilePictureUrl?: string permissions?: { notifications: boolean contacts: boolean } optedIntoOptionalAnalytics?: boolean worldAppVersion?: number deviceOS?: string}
In addition we have two helper functions to make it easier to get User information.
Using NextAuth you can easily create and manage sessions for your app. The starter template is already set up with NextAuth.
To extend this to other wallet providers, you simply need to trigger the wallet auth command and verify the response with verifySiweMessage.
Starting from World App 2.8.79 and higher, we support the standard SIWE verification library.
OAuth (Google, Apple, etc.): These providers are supported but it’s recommended to trigger this outside of the World App and then redirect back to your mini app with the access token worldapp://mini-app?app_id=appId&path=/handle-oauth?accessToken=....
Sign in with World ID: Not recommended as it doesn’t provide the user’s wallet address.