Test locally
On localhost the SDK answers with fakes, chosen in the page's query string, so you can build and draw everything before the space is listed.
How it works
The SDK runs in the local environment on localhost, 127.0.0.1 and [::1], or on any host with ?velven_local=1. It decides at once, before looking for Velven, so nothing waits.
- Scores go to an in-memory board per key, ranked by your page's own block:
sort,mode,min,maxandcooldownall apply. 3 fake players are seeded so the board has rows to draw. Nothing survives a reload. - Boards roll over as they do on Velven:
dailyat 00:00 UTC,weeklyon Monday.bucketandseasonread past ones back. Only the current bucket is seeded. - A page submit to a
serverboard is taken, with one console note that Velven would answerserver_only, so you can build a server-tier page without its function. Velven.datasaves tolocalStorageundervelven:data:local:alicefor?velven_user=alice, orvelven:data:local:guestwithout it, so changing the query string switches saves. It survives a reload; clear it from the browser's storage panel.- With no block on the page, or one that does not parse, score calls answer
no_boardand the console says why, once. The same warning appears in every environment.
Query parameters
?velven_user=alice- Signs in a fake player,
{ id: "local-alice", handle: "alice", avatar: null }, with a fake token good for an hour. Without it,signInanswerssigned_out, as for a guest. ?velven_token=expired- Makes the token already expired, so your refresh path runs and your server refuses it.
?velven_seed=120000,40000,9000- Sets the three seeded players' values, so the board looks like your game's.
?velven_seed=noneseeds nobody. ?velven_strict=1- Refuses a page submit to a
serverboard withserver_only, as Velven does. ?velven_slow=800- Waits that many milliseconds before every answer, so your loading states show.
?velven_local=1- Uses the local environment on any host.
On your own site
A top-level window on any other host is the site environment. The space plays, sign-in and score calls answer unavailable, and Velven.data uses the page's own localStorage. Check Velven.environment before drawing a board.