Management API Reference

JavaScript SDK

The Openfort SDK for JavaScript

Installation#

Prerequisites

In order to integrate Openfort, you project must:

Installing the Openfort SDK#

Installing the Openfort SDK is simple. npm packages are available for the latest version of the SDK.

Terminal

_10
npm install @openfort/openfort-js@latest

Note: If you experience complications, ensure you have the most recent release by running:


_10
# Using npm
_10
rm -Rf node_modules
_10
npm cache clean --force
_10
npm i
_10
_10
# Using yarn
_10
rm -Rf node_modules
_10
yarn cache clean
_10
yarn install

Initialization#

Each module of the Openfort SDK must be initialized with an instance of OpenfortSDKConfiguration. This configuration is shared across modules and defines settings such as the current environment.

Initialize an instance of OpenfortSDKConfiguration as follows:


_10
const sdk = new Openfort({ baseConfiguration: { publishableKey: "pk_test_XXXXXXX"} });

Supported Functionality#

The SDK supports a wide range of methods, including user authentication, wallet management, transaction signing, and more.

MethodFunctionality
InitInitializes OpenfortSDK with various parameters
LogInWithEmailPasswordLogs the user in using email and password
SignUpWithEmailPasswordSigns up a new user with email and password
LinkEmailPasswordLinks an email and password to the user account
UnlinkEmailPasswordUnlinks an email and password from the user account
RequestResetPasswordRequests a password reset
ResetPasswordResets the user's password
RequestEmailVerificationRequests an email verification
VerifyEmailVerifies the user's email
InitOAuthInitializes OAuth for the user
AuthenticateWithOAuthAuthenticates the user with OAuth
UnlinkOAuthUnlinks OAuth from the user account
PoolOAuthPools OAuth for the user account
InitLinkOAuthInitializes the link OAuth process
AuthenticateWithThirdPartyProviderAuthenticates the user with a third-party provider
InitSiweInitializes Sign-In with Ethereum (SIWE)
AuthenticateWithSiweAuthenticates the user with SIWE
LinkWalletLinks a wallet to the user account
UnlinkWalletUnlinks a wallet from the user account
StoreCredentialsStores authentication credentials
GetUserGets the user information
LogoutLogs the user out and removes stored credentials
GetAccessTokenGets the currently saved access token
ValidateAndRefreshTokenValidates and refreshes the access token
SendSignatureTransactionIntentRequestSends a signature transaction intent request
SignMessageSigns a message
SignTypedDataSigns typed data
SendSignatureSessionRequestSends a transaction signed by a session
GetEmbeddedStateGets the embedded state
GetEthereumProviderGets the Ethereum provider
ConfigureEmbeddedSignerConfigures the embedded signer