Build tools / server tooling
Deployment configuration
@silicon-jungle/inkwell-sdk/configDescribe your browser export and optional bundled Node.js backend.
Exact source · npm package · Reference version 0.0.8
API at a glance
defineGameConfig(config): configvalidateGameConfig(value): InkwellGameConfigINKWELL_BACKEND_IDLE_GRACE_SECONDS = 300
client.directory is required. Optional entrypoint selects an HTML file; engine.name/version records export metadata, not an engine compiler. capabilities.threads opts into browser isolation requirements.
startup.mode is handshake or compatible; timeoutMs accepts 5,000–600,000. Handshake waits for readiness, while compatible supports legacy exports.
backend.entry selects the JS/TS entrypoint. maxConnections defaults to 100 and accepts 1–10,000; resources supports memoryMb 256/512/1024/2048 and sharedCpus 1/2/4. Platform policy and actual availability still apply.
There is one on-demand process per game, not per match. The five-minute grace period is platform policy, not a configurable idle timer. No automatic multi-Machine scaling or arbitrary container uploads are exposed.
All exported symbols
BackendRegionINKWELL_BACKEND_IDLE_GRACE_SECONDSInkwellGameConfigdefineGameConfigvalidateGameConfig
Exact TypeScript API
Generated from the SDK source, including input options, return values, public types and overloads. Relative imports below are links between SDK source modules, not additional package subpaths. Only the entrypoints listed in the reference index are supported import paths.
export declare const INKWELL_BACKEND_IDLE_GRACE_SECONDS: 300;
export type BackendRegion = 'ams' | 'atl' | 'bom' | 'cdg' | 'dfw' | 'ewr' | 'fra' | 'gru' | 'iad' | 'jnb' | 'lax' | 'lhr' | 'nrt' | 'ord' | 'sea' | 'sin' | 'sjc' | 'syd' | (string & {});
export type InkwellGameConfig = {
game?: string;
client: {
directory: string;
entrypoint?: string;
engine?: {
name: 'web' | 'godot' | 'unity' | 'unreal';
version?: string;
};
capabilities?: {
threads?: boolean;
};
startup?: {
mode: 'handshake' | 'compatible';
timeoutMs?: number;
};
};
backend?: {
entry: string;
region?: BackendRegion;
maxConnections?: number;
resources?: {
memoryMb?: 256 | 512 | 1024 | 2048;
sharedCpus?: 1 | 2 | 4;
};
};
};
export declare function validateGameConfig(value: unknown): InkwellGameConfig;
export declare function defineGameConfig<const Config extends InkwellGameConfig>(config: Config): Config;
Supporting internal type declarations
These clarify types referenced by the generated signatures; do not import these internal paths directly.
game-services.d.ts
export declare class GameServiceError extends Error {
readonly status: number;
readonly code: string;
constructor(message: string, status?: number, code?: string);
}
export type GameServiceRequest = <T>(service: string, request: Record<string, unknown>) => Promise<T>;
export declare const requestGameService: GameServiceRequest;
/** Server-only adapter. Credentials must never be bundled into browser games. */
export declare function createGameServiceRequest(options: {
baseUrl: string;
token: string;
fetch?: typeof fetch;
}): GameServiceRequest;
protocol.d.ts
export declare const SDK_SOURCE: "inkwell-sdk";
export declare const SDK_VERSION: 1;
export type InkwellMessageType = "ready" | "loading.progress" | "loading.error" | "session.complete" | "analytics.track" | "assets.progress" | "player.get" | "presence.get" | "performance.sample" | "backend.connect" | "backend.fetch";
export type InkwellMessage = {
source: typeof SDK_SOURCE;
version: typeof SDK_VERSION;
type: InkwellMessageType;
payload?: Record<string, unknown>;
sentAt: number;
};
export declare function parentOrigin(): string | null;
export declare function requestId(): string;
export declare function emit(type: InkwellMessageType, payload?: Record<string, unknown>): boolean;