Coder Social home page Coder Social logo

gameup-web-sdk's Introduction

GameUp Web SDK

The Web SDK for the GameUp Service.

About

GameUp is a scalable, reliable, and fast gaming service for game developers.

The service provides the features and functionality provided by game servers today. Our goal is to enable game developers to focus on being as creative as possible and building great games. By leveraging the GameUp service you can easily add social login, gamer profiles, cloud game storage, and many other features.

For the full list of features check out our main documentation.

Setup

The client SDK is available on Bower.io

Using Bower.io

To include the library in your project:

bower install --save gameup-sdk

Getting Started

To use the GameUp SDK you will need an API Key. You can get one in the GameUp Dashboard.

The SDK has an asynchronous client API; Every client request uses a callback function to handle API responses.

var client = new GameUp.Client("Your API Key");
client.ping({
  success: function (status) {
    window.alert("Valid API Key");
  },
  error: function (status, response) {
    window.alert("Ping failed because " + response);
  }
});

Login a Gamer

Most features in the Game API require a gamer to be logged in. You can login a gamer anonymously and link a social account to their gamer token later.

To login a gamer:

var client = new GameUp.Client("Your API Key");
// A generated UUID; only generate one if you can't restore it from localStorage
var uniqueId = "8e9bbe7527924def93ba25025e46d884";
// Cache the UUID so the same gamer can be restored later
localStorage.setItem('gameupid', uniqueId);

// login the Gamer
client.loginAnonymous(uniqueId, {
  success: function(status, data) {
    localStorage.setItem('gamertoken', data.token);
  },
  error: function(status, data) {
    window.alert(data.message);
  }
});
// To reliably reload a gamer's account later; link their social account

More Documentation

For more examples and more information on features in the GameUp service have a look at our main documentation.

Note

The Web SDK is still in flux, we're looking for feedback from developers to make sure we're designing what you need to build incredible games. Please do get in touch and let us know what we can improve.

Developer notes

The Web SDK is written in Typescript. To develop on the codebase you'll need to install:

Building the codebase

  • npm install
  • gulp tsd
  • gulp compile

To compile and run tests:

  • npm test (for headless tests)

And open test/gameup-popup-test.html in your browser.

Contribute

All contributions to the documentation and the codebase are very welcome and feel free to open issues on the tracker wherever the documentation needs improving.

Lastly, pull requests are always welcome! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.