1.0.16 • Published 2 years ago
stardust-gg v1.0.16
Stardust-gg
interact with the stardust api over http using your favorite language - javascript! (typescript too!)
npm i stardust-gg
yarn add stardust-gg
Stardust dashboard setup
To hit the stardust api directly a few items must be completed.
- login to stardust
- create a game (preferrably an isolated one - called test) on polygon
- create an api key
- copy the api key into your
.env
file underSTARDUST_APIKEY
- create a template called test
- copy the template id into your
.env
file underTEMPLATE_ID
Create a game
// game.ts
import * as stardust from 'stardust-gg'
export const game = new stardust.Game('API_KEY_HERE')
Reference the game you created
// app.ts
import { game } from './game'
main()
.catch(console.error)
async function main() {
await game.health.check() // { data: { status: 'OK' } }
const { data: gameInstance } = await game.get()
const { data: player } = await game.player.get('PLAYER_ID_HERE')
}