npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@scoutsdk/server-sdk

v0.7.0

Published

Build powerful gaming community apps with magic. Scout delivers gaming stats to apps and websites.

Downloads

106

Readme

Scout is a gaming platform for app developers.

App developers need game stats data and other resources to build engaging apps for popular video games. We provide the data and the resources to do that. With Scout, these apps are better and more powerful, with less work for everyone. It's a win-win-win.

What's it for?

Your use of Scout depends on who you are:

  • For app developers, Scout is an easy to use and powerful SDK that gives you access to data and features that were once hard to come by.
  • For game developers, Scout is capable of collecting, analysing and storing data from the world's largest AAA titles. Want to know more? Contact us.

We've got some pretty legit features, too.

We know what features people love, so we've put them within reach.

  • Real-time statistics and analysis: We thought static data was getting a little stale, so we support pushing real-time updates to player profiles and statistics.
  • Global and regional leaderboards: Now apps can support up-to-the-second leader changes with the help of our real-time leaderboard system.
  • Session tracking + match history (coming soon!): Sometimes statistic totals don't show the whole story. Show users how they're progressing each time they play.
  • User profile information + friends lists (coming soon!): No more asking users for their gamer usernames. When a user visits your site, you'll know who they are automatically.

Turn it into a full-time job.

We love what developers are building, and we want to make it easier to continue pouring love into their projects.

  • In-app payments (coming soon!): Our payment flow removes the stress and overhead of enabling in-app payments.
  • Ad partnerships: Our ads can be displayed on a website or in an app. Revenue from the ads will be shared with the developer.

Getting Started

Ready to get started? Great! Our full documentation is available here. Below we'll outline the most common setup for a Node.js application and demonstrate how you can start using the SDK.

Install the SDK

First we need to get the SDK from npm.

npm install scout-sdk-server --save

Import and configure

Next you'll want to import the Scout SDK.

import Scout from 'scout-sdk-server';

For this next step you'll need to register an application through our developer dashboard.

Once Scout is imported we need to configure our application to use our client credentials (created during our app registration.)

Note: We're assuming you're in an async context so we can utilize ES7 async/await. You can create an async context by simply wrapping your code in an async function and invoking the function as a promise.

await Scout.configure({
  clientId: 'YOUR CLIENT ID HERE',
  clientSecret: 'YOUR CLIENT SECRET HERE',
  scope: 'public.read'
});

For now you can leave the scope as is, but you should refer to the documentation to better understand what scope you need to configure for your use.

Making your first call

We're ready to get some data from Scout!

Note your usage will be heavily rate limited while your app is unpublished.

// Lets get Scout's supported games or "titles", note we could also use Scout.titles.get(id)
let titles = await Scout.titles.list();

console.log(titles);

// Fortnite will be returned as one of the available titles, let's find it.
let fortnite = titles.find(t => t.slug === 'fortnite');

// Cool, but that information isn't super useful on its own. Let's use the title ID to search for a player.
// Note that we're using `fortnite.id` here, but we could just as well use the string literal "fortnite", which is Fortnite's `slug`.
// The second argument of the search method is the platform's `slug` -- this comes in handy when a title supports multiple platforms (such as Epic ("PC"), Xbox Live, and Playstation Network). This parameter can be left null, however you will have more success if you always include a value. Our search heuristics can cross reference gamertags and/or PSN IDs if they're in our system.
let search = await Scout.players.search('Ninja', 'epic', fortnite.id);

// Okay, now we have a list of zero or more results. In this case, it's probably an exact match. And we know Ninja plays Fortnite under this username, so we can assume that this search result exists.
let ninjasId = search.results[0].player.playerId;

// Let's get his stats!
let ninja = await Scout.players.get(fortnite.id, ninjasId, 'p9.br.m0.alltime');

console.log(ninja);

You'll notice the last parameter of the Scout.players.get method is seemingly made up. This is the "segment" of data that we want to see. In most games, player data can be segmented into several distinct profiles. Examples of this are segmenting the player's data by playlist, gametype, region, hero, etc.

We will always return some data if you specify null as the segment (or just ignore that parameter). Each game's documentation describes each game's segment key structure.

Where to go from here

We'd recommend you take a look at our docs to familiarize yourself with all that Scout has to offer.

Scout also offers monetization strategies for apps and websites. Want to offer in-app purchases on your website or serve ads in your app? We've got you covered.