Skip to content

About

Copy-and-adapt Scripted API (games_sapi) Luau scripts, recipes, payloads, types, and AI authoring docs.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Blazium Scripted API Examples

Copy-and-adapt Luau logic packs, recipes, route payload contracts, and type definitions for the Blazium Games Scripted API (https://sapi.blazium.online/v1/{game_uid}/{logic}).

Repository Map

Path Contents
base/ Byte-for-byte mirror of the ten ready-made base features (hub, daily, wheel, chests, quests, leaderboards, competitions, economy, lives, meta) and lib/ helpers, with per-feature READMEs and pinned source metadata in base/SOURCE.json.
examples/ The starter pack plus 18 self-contained recipes—each with runnable Luau scripts, a *.test.luau test suite, and a README.
payloads/ Request JSON, success envelopes, feature errors, platform error codes (4300–4324), and placeholder curl examples for every base route.
types/sapi.d.luau Luau type definitions for luau-lsp ("luau-lsp.types.definitionFiles": ["types/sapi.d.luau"]).
AGENTS.md Authoring rules, sandbox constraints, plan limits, and test conventions for AI agents.
llms.txt Machine-readable index of docs and repository files.
scripts/ sync_from_games_sapi.py, check_payloads.py, and scan_public.py.

Quickstart

1. Copy a recipe or base feature

Pick a recipe under examples/ (for example examples/starter or examples/hello) or copy from base/.

  • Remember: adding base feature files to a pack does not enable them on a live game. The game owner turns features on in Scripted API → Features (lives also requires economy).
  • Point luau-lsp at types/sapi.d.luau and keep .luaurc at the workspace root.

2. Static checks (works everywhere, matches CI)

This repository pins Luau 0.743 (matching games_sapi) from luau-lang/luau releases:

# Typecheck/lint every .luau file (types/sapi.d.luau uses luau-lsp `declare` syntax and is excluded)
find base examples -type f -name '*.luau' ! -name '*.d.luau' | sort | xargs luau-analyze

# Validate payloads, JSON files, and example layout
python3 scripts/check_payloads.py

# Verify no secrets, internal hostnames, IPs, or staff-only routes exist
python3 scripts/scan_public.py

3. Full runtime tests & publish (requires SapiServer)

Full manifest validation (--validate) and runtime execution of *.test.luau suites (--test) require a SapiServer Linux build (because games_sapi is a private repository and no public SapiServer release binary or container image is hosted for public CI).

When you have SapiServer on Linux or WSL2 (and chauffeur from blazium-games/games_cli):

chauffeur sapi validate --dir examples/starter --plan free
chauffeur sapi test --dir examples/starter
chauffeur sapi publish --dir examples/starter --channel beta --activate

Recipes (examples/)

Recipe Demonstrates
starter Upstream starter pack (hello, submit_score, leaderboard, daily_reset, lib/scores)
hello Minimal anonymous GET route
submit-score Authenticated POST score submit with std.validate, data.user, board, progress
leaderboard Public board reads (top, rank, around, count)
daily-reset UTC cron schedule (schedule.cron), board:reset(), data.global
idempotent-claim HTTP Idempotency-Key behavior + atomic data.user:cas claim dedup
secrets-and-config config.get defaults and write-only secrets.get
rate-limiting Manifest rate + per-action std.ratelimit with 429 + Retry-After
outbound-http api.http, http.allow, HTTPS-only enforcement, error handling (pcall)
api-call Intra-pack api.call across logics (CALL:* and method = "GET")
internal-only CALL:* + guard.internal logic unreachable from public clients
webhook-send webhook.send allowlist, HMAC-SHA256 signing secret, post-commit delivery
progress-and-stats progress.unlock, progress.stat (set/add/max/min), progress.event
items-grant-and-list items.grant and items.list (items capability)
lobby-calls lobby.* calls from Scripted API + games_slobby counterpart design
extend-base-feature Extending base/daily.luau with a custom reward table & route
custom-feature Writing a new crafting feature alongside economy using base/lib/
custom-endpoint A plain custom route with read, validated and server-only actions; scaffold with chauffeur sapi logic add, call with chauffeur sapi call
paid-endpoint Metered HTTP 402 (MPP + x402 V2) and Solana Payment Channel endpoint using payment = { price_cents, mode }

Not included

The Blazium feature catalog lists a few capabilities that are not exposed as Scripted API globals or uses entries in types/sapi.d.luau, so no Scripted API recipe is included for them:

  • inbox — capability entry in the platform catalog; no Scripted API global is declared in types/sapi.d.luau.
  • profiles — capability entry in the platform catalog; no Scripted API global is declared in types/sapi.d.luau.
  • lobby_data — applies to scripted lobby packs (data.lobby inside games_slobby), not to Scripted API (games_sapi) logic packs.

Official Documentation

About

Copy-and-adapt Scripted API (games_sapi) Luau scripts, recipes, payloads, types, and AI authoring docs.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages