0.6.53 • Published 1 day ago

@openfort/openfort-node v0.6.53

Weekly downloads
-
License
MIT
Repository
github
Last release
1 day ago

Openfort Protocol

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.

0.6.53

1 day ago

0.6.52

4 days ago

0.6.51

8 days ago

0.6.50

16 days ago

0.6.49

1 month ago

0.6.48

1 month ago

0.6.47

1 month ago

0.6.46

1 month ago

0.6.45

2 months ago

0.6.44

3 months ago

0.6.43

3 months ago

0.6.42

3 months ago

0.6.41

3 months ago

0.6.40

3 months ago

0.6.39

3 months ago

0.6.38

3 months ago

0.6.36

3 months ago

0.6.35

3 months ago

0.6.34

4 months ago

0.6.33

4 months ago

0.6.32

4 months ago

0.6.31

4 months ago

0.6.30

5 months ago

0.6.21

6 months ago

0.5.10

9 months ago

0.6.20

6 months ago

0.5.11

9 months ago

0.6.23

6 months ago

0.6.22

6 months ago

0.4.9

10 months ago

0.4.8

10 months ago

0.6.9

7 months ago

0.6.8

7 months ago

0.6.29

5 months ago

0.6.28

6 months ago

0.6.6-beta.0

8 months ago

0.5.16

9 months ago

0.6.25

6 months ago

0.5.14

9 months ago

0.6.24

6 months ago

0.5.15

9 months ago

0.6.27

6 months ago

0.5.12

9 months ago

0.6.26

6 months ago

0.5.13

9 months ago

0.6.10

7 months ago

0.6.12

7 months ago

0.6.11

7 months ago

0.6.18

6 months ago

0.6.17

6 months ago

0.6.19

6 months ago

0.6.14

6 months ago

0.6.13

6 months ago

0.6.16

6 months ago

0.6.15

6 months ago

0.5.4

10 months ago

0.5.3

10 months ago

0.5.6

9 months ago

0.5.5

9 months ago

0.5.0

10 months ago

0.5.2

10 months ago

0.5.1

10 months ago

0.5.8

9 months ago

0.5.7

9 months ago

0.5.9

9 months ago

0.6.20-rc

6 months ago

0.6.3

8 months ago

0.4.5

10 months ago

0.6.2

8 months ago

0.4.4

10 months ago

0.6.5

8 months ago

0.4.7

10 months ago

0.6.4

8 months ago

0.4.6

10 months ago

0.4.1

10 months ago

0.4.0

10 months ago

0.6.1

9 months ago

0.4.3

10 months ago

0.6.0

9 months ago

0.4.2

10 months ago

0.3.1

11 months ago

0.3.0

11 months ago

0.2.9

11 months ago

0.2.8

11 months ago

0.2.7

11 months ago

0.2.6

11 months ago

0.2.5

11 months ago

0.2.4

11 months ago

0.2.3

11 months ago

0.2.2

12 months ago

0.1.8

12 months ago