Quickstart
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:
- Multiple authentication methods
- Bare-metal API access to customize your own UI
- Non-custodial embedded wallet
- 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 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:
- Scroll to the Shield section and click Create Shield keys
- Store the encryption share safely when it appears (you'll only see it once)
- 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: