Liking cljdoc? Tell your friends :D

game.gm.config


avatar-enabled?clj

(avatar-enabled?)

The Avatar Protocol can reach a provider when the configured provider resolves with its required credentials present. Today only "yvatar" is wired, which needs YVATAR_API_TOKEN (base URL defaults).

The Avatar Protocol can reach a provider when the configured provider resolves
with its required credentials present. Today only "yvatar" is wired, which
needs YVATAR_API_TOKEN (base URL defaults).
raw docstring

build-configclj

(build-config args)

connect-enabled?clj

(connect-enabled?)

Stripe Connect (player withdrawals) is enabled when STRIPE_CONNECT_ENABLED is not explicitly turned off and Stripe itself is configured. Defaults on when a secret key is present, mirroring stripe-enabled?.

Stripe Connect (player withdrawals) is enabled when STRIPE_CONNECT_ENABLED is
not explicitly turned off and Stripe itself is configured. Defaults on when a
secret key is present, mirroring stripe-enabled?.
raw docstring

default-gm-portclj


default-gm-urlclj


default-mom-urlclj


mom-auth-headersclj

(mom-auth-headers)

Headers for outbound calls to MoM. Uses the short-lived service JWT when valid; falls back to the static game token.

Headers for outbound calls to MoM.
Uses the short-lived service JWT when valid; falls back to the static game token.
raw docstring

parse-cli-game-nameclj

(parse-cli-game-name args)

refresh-service-token!clj

(refresh-service-token! mom-url)

Fetches a new service JWT from MoM and stores it in the local state atom. Returns true on success, false on failure.

Fetches a new service JWT from MoM and stores it in the local state atom.
Returns true on success, false on failure.
raw docstring

resolve-app-base-urlclj

(resolve-app-base-url)

resolve-avatar-providerclj

(resolve-avatar-provider)

Which avatar provider implementation to use. Defaults to "yvatar".

Which avatar provider implementation to use. Defaults to "yvatar".
raw docstring

resolve-connect-refresh-urlclj

(resolve-connect-refresh-url)

Where Stripe sends the player if the onboarding link expires / needs a retry.

Where Stripe sends the player if the onboarding link expires / needs a retry.
raw docstring

resolve-connect-return-urlclj

(resolve-connect-return-url)

Where Stripe returns the player after Express onboarding. Falls back to the app base URL with a connect-return marker.

Where Stripe returns the player after Express onboarding. Falls back to the
app base URL with a connect-return marker.
raw docstring

resolve-game-nameclj

(resolve-game-name args)

resolve-market-payment-providerclj

(resolve-market-payment-provider)

resolve-mom-api-tokenclj

(resolve-mom-api-token)

Returns the token MoM sends when calling THIS GAME (e.g. payout withdrawals). Used to validate inbound calls FROM MoM — not for calling MoM. Reads MOM_GM_OUTBOUND_TOKEN only.

Returns the token MoM sends when calling THIS GAME (e.g. payout withdrawals).
Used to validate inbound calls FROM MoM — not for calling MoM.
Reads MOM_GM_OUTBOUND_TOKEN only.
raw docstring

resolve-mom-game-tokenclj

(resolve-mom-game-token)

Returns the token THIS GAME uses when calling MoM (e.g. registration, GM events, treasury calls). Distinct from resolve-mom-api-token which validates inbound calls from MoM.

Prefers the generic MOM_GAME_TOKEN. The two per-game names are legacy: this function used to enumerate every deployment, which meant a NEW Game Master physically could not present a credential until gm-lib was edited and republished — a library release standing between someone and their first registration. Read the generic name first so a third, fourth and fifth GM need no change here; keep the old names working so the-js and aow are untouched.

Each deployment sets exactly one; they are distinct on the MoM side.

Returns the token THIS GAME uses when calling MoM (e.g. registration,
GM events, treasury calls). Distinct from resolve-mom-api-token which
validates inbound calls from MoM.

Prefers the generic MOM_GAME_TOKEN. The two per-game names are legacy: this
function used to enumerate every deployment, which meant a NEW Game Master
physically could not present a credential until gm-lib was edited and
republished — a library release standing between someone and their first
registration. Read the generic name first so a third, fourth and fifth GM
need no change here; keep the old names working so the-js and aow are
untouched.

Each deployment sets exactly one; they are distinct on the MoM side.
raw docstring

resolve-owner-idclj

(resolve-owner-id)

resolve-player-group-idclj

(resolve-player-group-id)

resolve-stripe-publishable-keyclj

(resolve-stripe-publishable-key)

resolve-stripe-secret-keyclj

(resolve-stripe-secret-key)

resolve-stripe-webhook-secretclj

(resolve-stripe-webhook-secret)

resolve-yvatar-api-tokenclj

(resolve-yvatar-api-token)

Credential the GM presents to Yvatar's platform API.

Prefers YVATAR_SERVICE_TOKEN — an APP credential — over the legacy personal YVATAR_API_TOKEN (yvtr_...). This is not tidiness: a personal token resolves avatars scoped to ITS OWNER, so once a player links an avatar from their own Yvatar account the GM cannot read it and every avatar/* call 404s. The service token resolves by external identity instead, which is what player-owned avatars require.

It is also narrower. The personal token could read everything its owner owned, linked or not; the service token reaches only what a player has actually connected to a seat.

The yvtr_ fallback remains so an existing deployment does not break mid-roll, but it cannot serve player-owned avatars and should be removed.

Credential the GM presents to Yvatar's platform API.

Prefers YVATAR_SERVICE_TOKEN — an APP credential — over the legacy personal
YVATAR_API_TOKEN (yvtr_...). This is not tidiness: a personal token resolves
avatars scoped to ITS OWNER, so once a player links an avatar from their own
Yvatar account the GM cannot read it and every avatar/* call 404s. The service
token resolves by external identity instead, which is what player-owned
avatars require.

It is also narrower. The personal token could read everything its owner owned,
linked or not; the service token reaches only what a player has actually
connected to a seat.

The yvtr_ fallback remains so an existing deployment does not break mid-roll,
but it cannot serve player-owned avatars and should be removed.
raw docstring

resolve-yvatar-base-urlclj

(resolve-yvatar-base-url)

Base URL of the Yvatar Developer Platform API for SERVER-TO-SERVER calls.

Prefers YVATAR_INTERNAL_URL. These are two different addresses for the same service and must not be collapsed: YVATAR_BASE_URL is browser-facing (the picker link the SPA builds, which must be reachable from the user's browser — localhost:3000), while this provider calls Yvatar from inside the GM container, where localhost is the GM itself. When Yvatar runs as a compose service the internal address is the service name (http://yvatar:3000).

Falls back to YVATAR_BASE_URL for single-host setups where both are the same.

Base URL of the Yvatar Developer Platform API for SERVER-TO-SERVER calls.

Prefers YVATAR_INTERNAL_URL. These are two different addresses for the same
service and must not be collapsed: YVATAR_BASE_URL is browser-facing (the
picker link the SPA builds, which must be reachable from the user's browser —
localhost:3000), while this provider calls Yvatar from inside the GM container,
where localhost is the GM itself. When Yvatar runs as a compose service the
internal address is the service name (http://yvatar:3000).

Falls back to YVATAR_BASE_URL for single-host setups where both are the same.
raw docstring

resolve-yvatar-marketplace-service-tokenclj

(resolve-yvatar-marketplace-service-token)

Credential used only for The J -> Yvatar marketplace preparation and fulfillment calls. It may be separated from the avatar API credential in production; existing deployments can use the shared service token.

Credential used only for The J -> Yvatar marketplace preparation and
fulfillment calls. It may be separated from the avatar API credential in
production; existing deployments can use the shared service token.
raw docstring

resolve-yvatar-stripe-account-idclj

(resolve-yvatar-stripe-account-id)

Yvatar's Standard Connect account. Seller-owned credit checkouts are direct charges on this account, never charges collected into The J's balance.

Yvatar's Standard Connect account. Seller-owned credit checkouts are direct
charges on this account, never charges collected into The J's balance.
raw docstring

start-token-refresh-loop!clj

(start-token-refresh-loop! mom-url)

Starts a daemon thread that checks every 60s and refreshes the service JWT when less than 50% TTL remains. Returns the thread.

Starts a daemon thread that checks every 60s and refreshes the service JWT
when less than 50% TTL remains. Returns the thread.
raw docstring

stripe-enabled?clj

(stripe-enabled?)

verbose-logging?clj

(verbose-logging?)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close