Integrating OAuth & Social Logins
Overview
Capsule supports various OAuth methods to authenticate users across different platforms. Currently supported platforms include Google, Facebook, Discord, Twitter, and Apple.
Capsule automatically links wallets with a common email identifier to avoid creating duplicate wallets if users choose different methods in different sessions. Because of this, users must have an email associated with their login account of choice. Without an email linked to the account, authentication will fail and the user will see a prompt to either add email to their social account or try a different method
Integrating Social Logins
Capsule Modal
Social Logins can be easily integrated via the CapsuleModal
Component by passing the desired options as an array to the oAuthMethods
property as follows.
Custom UI Entrypoint
For developers preferring manual control over launching an authentication process or leveraging a custom implementation, the following can be used to obtain OAuth URLs
Farcaster OAuth Login
Farcaster Login works very similarly to the other social logins, except that there is no email associated with the account. Rather, we will be using the farcaster username as the identifier for this user. This is important to keep in mind, as the functions used in the SDK will be different. Here is some example code for implementing farcaster login:
As always, if you need further help please feel free to reach out to us directly or get in touch at support@usecapsule.com. We're always excited to hear feedback!
Last updated