1.1.0 • Published 4 years ago

@grid-esports/widget-sdk v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

GRID Widget SDK

Overview

This is the GRID esports Widget SDK providing a series of tools to enable you to use our pre-built widgets within the context of your own site.

Available Widgets

SeriesTournament
series-scoreboardtournament-list
series-table
series-predictions-tracker
series-team-scoreboard
series-livelog
series-timeline
series-comparison
series-map-schematic

Terminology

TermDefinitionExamples
ScopeThis is the scope of data you want to see inside the widget.series-scoreboard = {type: 'series', id: '1'}
TitleThe given name of a video game that's played as an esportCSGO, LoL, DOTA etc.
SeriesA group of games played between the different teams played within a format Bo3 etc.Astralis vs Sprout
GameA (individual) section of a series, being played out on a fixed map.CSGO Map, DOTA Map
SegmentA section of a game or other segmentCSGO (Warmup/Round)

Use

Scope

Scope is the most important part of connecting to the widgets, this parameter describes what data you'd like to be able to see inside the widget itself. Most widgets currently only support a single type of scope however this is flexible for the future.

Scope is defined in the following format;

{
  "id": "1",
  "type": "series"
}
NameDescriptionTypeExamples
IDThe ID of the entity from central data you'd like to subscribe tostring"1", "2034"
typeThe entity from central data you'd like to subscribe toenum "series" | "tournament""series", "tournament"

Pure JS

We provide a Pure JS version of the code

import { loadWidget } from '@grid-esports/widget-sdk';

loadWidget({
    el: "root",
    type: 'series-scoreboard',
    scope: {
        type: 'series',
        id: ,
    },
})

React

import React from 'react';
import ReactDOM from 'react-dom';

import { Widget } from "@grid-esports/widget-sdk/react";

ReactDOM.render(
  <Widget type="series-scoreboard" scope={{type: 'series', id: '1'}} />,
  document.getElementById('root'),
)
1.1.0

4 years ago

1.0.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago