Skip to content

A REST client for Fortnite which allows requesting game news, streams and more soon !

License

Notifications You must be signed in to change notification settings

Horziox/ftn-client

Repository files navigation

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

About

A REST client for Fortnite which allows requesting game news, streams and more soon !

Topics

Resources

License

Stars

Watchers

Forks