Skip to main content
The Circle Web SDK enables user-controlled wallets within your web application. Three authentication methods are supported, namely social logins, email, or PIN, which includes security questions for recovery. This allows you to authenticate your users in a seamless way and create user-controlled wallets for them. By integrating this client-side SDK, your users can securely create wallets and make transactions using social accounts or email. If you choose the PIN authentication method, your users can input sensitive data, like PINs or security answers, in a secure way. Moreover, the SDK encrypts the request body sent by the application, protecting your users’ information.
Note:The Web and Mobile SDKs preserve the user keyshare with the individual, giving them complete control. You must use the SDKs with the user-controlled wallet product. Additionally, the Web and Mobile SDKs support only the user-controlled wallet product.
At Circle, we understand the importance of end-to-end security for your application and the need to create a tailored and seamless user experience for your end-users. Hence, Circle’s SDK also exposes functionality for you to customize the description and layout. See the Web SDK UI Customization API article to customize the SDK.

Install the SDKs

Install using npm:
Shell

SDK architecture

You must use Web, iOS, or Android SDKs to access the user-controlled Programmable Wallet product. The SDK secures, manages, and communicates with your server to ensure your user’s keyshare, always stays with them and is not exposed to your servers. To learn more, see How it works.

SDK API references: enums

The Web SDK supports the API reference enums listed in the following sections.

ChallengeType

Enumerates the types of challenges supported.
JavaScript

ChallengeStatus

Enumerates the possible status for a challenge.
JavaScript

QuestionType

Enumerates the types of security questions.
JavaScript

ErrorCode

Enumerates the types of error code.
JavaScript

SDK API references: interfaces

The Web SDK supports the interfaces listed in the following sections.

Configs

AppSettings

Holds application settings.
  • appId <string> Application ID, retrieved from Circle Developer Services Console

Authentication

Holds authentication information.

LoginConfigs

Holds login configuration information.

Definitions

  • google: Configuration object for Google login.
    • clientId: The Client ID for Google login.
    • redirectUri: The Redirect URI for Google login.
    • selectAccountPrompt: Whether to prompt the user to select an account when signing in.
      Learn more about how prompt works in the Google OAuth API documentation (keyword: prompt).
  • facebook: Configuration object for Facebook login.
    • appId: The App ID for Facebook login.
    • redirectUri: The Redirect URI for Facebook login.
  • apple: Configuration for Apple login, using Firebase.
  • FirebaseOptions: The Firebase configuration object.
  • deviceToken: The token used to identify the device.
  • deviceEncryptionKey: The encryption key used for the device.
  • otpToken: The optional OTP token for verification.

SocialLoginProvider

Challenge

Holds information about a challenge.

ChallengeResult

Holds the result of a challenge.

SignMessageResult

Holds the result of a sign message or sign typed-data challenge.
  • signature <string> Signature result after signing

SignTransactionResult

Holds the result of a sign transaction challenge.
  • signature <string> Signature result after signing
  • txHash <string> Transaction hash
  • signedTransaction <string> Signed transaction

SocialLoginResult

Holds the result of a social login.

EmailLoginResult

Holds the result of an email login.

OauthInfo

Holds the OAuth information.

Error

Holds error information.

SocialLoginCompleteCallback

Callback function for social login completion.

SecurityQuestion

Holds information about a custom security question.

Localizations

Holds localization settings.

Common

Holds localization settings for common texts.

ConfirmPincode

Holds localization settings for ConfirmInitPincode or ConfirmNewPincode screen.

EnterPincode

Holds localization settings for EnterPincode screen.

NewPincode

Holds localization settings for InitPincode or NewPincode screen.

RecoverPincode

Holds localization settings for RecoverPincode screen.

SecurityConfirm

Holds localization settings for SecurityConfirm screen.

SecurityIntros

Holds localization settings for SecurityIntros screen.

SecurityQuestions

Holds localization settings for SecurityQuestions screen.

SecuritySummary

Holds localization settings for SecuritySummary screen.

SocialEmailConfirmationUI

Holds localization settings for SocialEmailConfirmationUI screen.

TransactionRequest

Holds localization settings for TransactionRequest screen.

ContractInteraction

Holds localization settings for a contract interaction screen.

SignatureRequest

Holds localization settings for a signature request screen.

EmailOtp

Holds localization settings for an email OTP (One-Time Password) screen.

ThemeColor

Holds customization color settings.

Resources

Holds resource urls and properties, such as images or font-family settings. These resource properties should be hosted on a public server. SDK will load these resources from the urls provided. Holds custom links.

Class Definition

The Web SDK supports the class definitions listed in the following sections.

W3SSdk

Constructor

Initializes a new instance of W3SSdk.

Methods

execute
Executes a challenge.
setAppSettings
Sets the application settings.
setAuthentication
Sets the authentication information.
updateConfigs
Updates the configurations.
getDeviceId
Gets the device ID.
performLogin
Performs a social login.
verifyOtp
Verifies the OTP.
execute
Executes a challenge.
setCustomSecurityQuestions
Sets custom security questions.
setLocalizations
Sets custom localizations
setResources
Sets custom resources
setThemeColor
Sets custom theme colors
setCustomLinks
Sets custom links
setOnForgotPin
Sets callback function for ForgotPin button click event
setOnResendOtpEmail
Sets callback function for Resend OTP Email button click event

Sample code

React.js

JavaScript

Vanilla JavaScript

JavaScript