Socket
Book a DemoInstallSign in
Socket

@openfort/openfort-node

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfort/openfort-node

OpenAPI client for Openfort API

0.6.71
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Illustration_04 1-min

Website | Documentation | API Docs | Twitter

Openfort Node.js Library

Version

The Openfort Node library provides convenient access to the Openfort API from applications written in server-side JavaScript.

Documentation

See the openfort-node API docs for Node.js.

Requirements

Node 14 or higher.

Installation

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

Usage

The package needs to be configured with your account's secret key, which is available in the Openfort Dashboard. Require it with the key's value:

const openfort = require('@openfort/openfort-node')('sk_test_...');

openfort.players.create({
    name: 'Joan McCoain',
    description: 'API created player'
})
  .then(player => console.log(player.id))
  .catch(error => console.error(error));

Or using ES modules and async/await:

import Openfort from '@openfort/openfort-node';
const openfort = new Openfort('sk_test_...');

const player = await openfort.players.create({
    name: 'customer@example.com',
    description: 'API created player'
});

console.log(player.id);

Below code snippet shows exemplary usage of the configuration and the API.

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

async function example() {
    const openfort = new Openfort("sk_test_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
    const players = await openfort.players.list();
    for (const player of players.data) {
        console.log(player.id);
    }

    const newPlayer = await openfort.players.create({name: "Test"});
    console.log(newPlayer.id)

    const transactionIntents = await openfort.transactionIntents.list();
    for (const intent of transactionIntents.data) {
        console.log(`Intent ${intent.id} by ${intent.player.name}`);
    }
}

example().catch((e) => console.error(e));

Support

New features and bug fixes are released on the latest major version of the openfort package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.

Keywords

fetch

FAQs

Package last updated on 03 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.