Skip to content

Quickstart

The Openfort JS SDK is a low level library that allows you to build custom login flows, request signatures and more.
Want to start building right away?

If you're looking to quickly build with auth UI elements into your app, check out our React guides.

You will get out of the box support for:

  1. Multiple authentication methods
  2. Bare-metal API access to customize your own UI
  3. Non-custodial embedded wallet
  4. Account abstraction compatible and infrastructure

Check out the starter repos for templates for integrating Openfort with various libaries, frameworks and use cases.

Install the Openfort SDK

Install the latest version of the Openfort JS SDK using your package manager of choice:

npm
npm install @openfort/openfort-js@latest

Set your auth providers

Navigate to the auth providers page on the Openfort dashboard by selecting your project and then clicking Auth providers Methods in the side bar in the users page. Select the account types you'd like users to be able to login with. For more information on how to enable social logins, check out the dashboard docs.

Get your API keys

In the API keys section, you'll find:

  • Publishable Key: Safe to expose in client-side environment
  • Secret Key: Must be kept secure and used only server-side

To generate non-custodial wallets:

  1. Scroll to the Shield section and click Create Shield keys
  2. Store the encryption share safely when it appears (you'll only see it once)
  3. You'll receive:
    • Shield Publishable Key: Safe for client-side use
    • Shield Secret Key: Keep secure, server-side only

Import Openfort into your app

In your project, import the Openfort and configure it. Set the publishable keys fields to the publishable key you got from the Dashboard in step 3.

Concretely, the Openfort SDK needs to be instantiated only once.

import Openfort from "@openfort/openfort-js";
 
const openfort = new Openfort({
  baseConfiguration: {
    publishableKey: "YOUR_OPENFORT_PUBLISHABLE_KEY",
  },
  shieldConfiguration: {
    shieldPublishableKey: "YOUR_SHIELD_PUBLISHABLE_KEY",
  }
});

You're good to go!

Once you've configured your app, you can now use openfort throughout to access the Openfort SDK.

Check out our starter repo to see what a simple end-to-end integration looks like, or read on to learn how you can use Openfort to: