ftn-client
TypeScript icon, indicating that this package has built-in type declarations

0.1.2-alpha • Public • Published

Fortnite Client

npm version npm downloads CodeQL

⚠️ This repo is in alpha phase !

Install: npm install ftn-client

Infos

The main purpose of this library is to provide the basic services of Fortnite, without having Epic account or a dedicated token for your client like fnbr.js

This library is therefore less complete but suddenly lighter to perform basic tasks or complete some tests

Usage Example

Download News Streams (TS)

import { Client } from 'ftn-client';
import fs from 'fs';

const client = new Client({
  language: 'en', // default language
  region: 'EU' // default region
})

(async () => {
  // Start the client
  await client.start();
  
  // Get BR News
  const BRnews = client.BRNews;
  for(const thisNew of BRnews.news) {
    if(thisNew.stream !== null) {
      // Download MP4 Buffer
      // Default client language and 720p resolution
      const video = await thisNew.stream.downloadStream();
      
      // Create MP4 file
      fs.writeFileSync(thisNew.stream.fileName, video);
    }
  }
})()

Get token (TS)

import { Client } from 'ftn-client';

const client = new Client();

(async () => {
  // Start the client
  await client.start();
  
  // Get client Auth an log the EG1 token
  const auth = client.auth;
  console.log(auth.access_token);
})()

More detailed examples in javascript are presents in the examples folder

Documentation

Documentation available soon...

Contact

Package Sidebar

Install

npm i ftn-client

Weekly Downloads

1

Version

0.1.2-alpha

License

MIT

Unpacked Size

53.6 kB

Total Files

34

Last publish

Collaborators

  • horziox