openfort-xyz
openfort-node
TypeScript

Node.js SDK to interact with Openfort wallet infrastructure.

Last updated Jul 30, 2026
10
Stars
7
Forks
10
Issues
0
Stars/day
Attention Score
56
Language breakdown
TypeScript 99.4%
Makefile 0.5%
JavaScript 0.2%
Files click to expand
README

Openfort

Server-side SDK for managing EVM and Solana wallets, gas sponsorship, and blockchain interactions.

npm version npm downloads Follow @openfort</em>hq MIT License


Table of Contents

- Wallet Management - Signing - Gas Sponsorship - IAM \& Authentication

Overview

The Openfort Node.js SDK provides convenient access to the Openfort API for server-side applications. It enables developers to:

  • Create and manage EVM and Solana backend wallets
  • Sign messages, typed data, and transactions
  • Execute gasless transactions with gas sponsorship policies
  • Manage users, accounts, and transaction intents
  • Integrate with smart contracts and token swaps

Installation

Requires Node.js 18 or higher.

npm install @openfort/openfort-node
yarn add @openfort/openfort-node
pnpm add @openfort/openfort-node

Quickstart

Get your API key from the Openfort Dashboard.

import Openfort from "@openfort/openfort-node";

const openfort = new Openfort("sktest...", { walletSecret: "your-wallet-secret", // Required for signing operations });

// Create an EVM backend account const account = await openfort.accounts.evm.backend.create(); console.log("Account address:", account.address);

// Sign a message (methods are on the account object) const signature = await account.signMessage({ message: "Hello, Openfort!", }); console.log("Signature:", signature);

Features

Wallet Management

Create and manage wallets across EVM chains and Solana:

// EVM backend accounts
const evmAccount = await openfort.accounts.evm.backend.create();

// Solana backend accounts const solanaAccount = await openfort.accounts.solana.backend.create();

// Import existing wallet const imported = await openfort.accounts.evm.backend.import({ privateKey: "0x...", });

Signing

Sign messages, typed data, and transactions. Methods are called directly on the account object:

// Sign message
const signature = await account.signMessage({
  message: "Hello, Openfort!",
});

// Sign EIP-712 typed data const typedSig = await account.signTypedData({ domain: { name: "MyApp", version: "1", chainId: 1 }, types: { Person: [ { name: "name", type: "string" }, { name: "wallet", type: "address" }, ], }, primaryType: "Person", message: { name: "Alice", wallet: "0x..." }, });

Gas Sponsorship

Sponsor gas fees for your users. Create a policy with criteria-based rules, then link it to a fee sponsorship:

// 1. Create a policy that accepts transactions on Polygon
const policy = await openfort.policies.create({
  scope: "project",
  rules: [
    {
      action: "accept",
      operation: "sponsorEvmTransaction",
      criteria: [
        { type: "evmNetwork", operator: "in", chainIds: [137] },
      ],
    },
  ],
});

// 2. Create a fee sponsorship linked to that policy const sponsorship = await openfort.feeSponsorship.create({ name: "Free gas for users", strategy: { sponsorSchema: "payforuser" }, policyId: policy.id, });

IAM & Authentication

Manage users and verify sessions:

// List authenticated users
const users = await openfort.iam.users.list({ limit: 10 });

// Verify session from access token const session = await openfort.iam.getSession({ accessToken }); console.log("User ID:", session.user.id); console.log("Session expires:", session.session.expiresAt);

Examples

The SDK includes comprehensive examples for all features. See the examples directory for runnable code.

| Category | Examples | | ---------------- | -------------------------------------------------- | | EVM Wallets | Create, import, export, sign messages/transactions | | Solana Wallets | Create, import, export, sign messages/transactions | | Policies | Criteria-based rules for EVM and Solana operations | | Fee Sponsorship | Create, update, enable/disable gas sponsorship | | Transactions | Create intents, estimate gas | | IAM | User management, session verification |

Run examples:

cd examples
cp .env.example .env

Edit .env with your API key

pnpm example evm/accounts/createAccount.ts

Documentation

Support

New features and bug fixes are released on the latest major version. We recommend upgrading to the latest version for security updates and new functionality.

License

This project is licensed under the MIT License.

© 2026 GitRepoTrend · openfort-xyz/openfort-node · Updated daily from GitHub