Access Gate API
Control access to premium APIs based on user authentication status.
Overview
The Access Gate sits in front of sensitive SDK methods (TextGen, ImageGen, AudioGen, ThreeDGen, and UGC account mutations) and blocks anonymous users from calling them. When a gated method is invoked:
The gate checks whether the current user is authenticated.
If auto-prompt login is enabled, the SDK automatically shows a login prompt.
If the user logs in successfully the original call proceeds. Otherwise the returned Promise rejects with an
AccessDeniedError.
This lets you build features that gracefully degrade for anonymous users while keeping premium functionality behind authentication.
Quick Start
import RundotGameAPI from '@series-inc/rundot-game-sdk/api'
import { AccessDeniedError } from '@series-inc/rundot-game-sdk'
// Auto-prompt is ON by default: anonymous users see the login prompt
// automatically when calling a gated method.
try {
const result = await RundotGameAPI.imageGen.generate({
prompt: 'A cute pixel art cat',
})
} catch (error) {
if (error instanceof AccessDeniedError) {
// User cancelled or dismissed the login prompt
console.log('Login required to generate images')
}
}Gated Namespaces & Methods
The following SDK methods are protected by the Access Gate and require an authenticated user:
TextGen
textGen.generate(params)
Generate text from a prompt
textGen.requestChatCompletionAsync(params)
Low-level chat completion
textGen.requestChatCompletionStreamAsync(params)
Streaming chat completion
textGen.requestPromptCompletionAsync(params)
Low-level prompt completion
textGen.requestPromptCompletionStreamAsync(params)
Streaming prompt completion
ImageGen
imageGen.generate(params)
Generate an image from a prompt
imageGen.edit(params)
Edit an existing image
imageGen.expand(params)
Outpaint / expand an image canvas
imageGen.restyle(params)
Restyle an image
imageGen.removeBackground(params)
Remove background from an image
imageGen.upscale(params)
Upscale an image
imageGen.batch(params)
Run a batch of image operations
imageGen.session(params)
Multi-turn image editing session
AudioGen
audioGen.generate(params)
Generate audio from a prompt
audioGen.designVoices(params)
Design candidate voices
audioGen.saveDesignedVoice(params)
Save a designed voice for reuse
ThreeDGen
threeDGen.generate(params)
Generate a 3D model
threeDGen.remesh(params)
Remesh an existing model
threeDGen.rig(params)
Rig a model for animation
threeDGen.animate(params)
Animate a rigged model
UGC account mutations
Browse, get, and recordUse remain ungated. recordUse accepts anonymous users so plays can be counted without prompting them to log in. Account mutations require authentication.
ugc.create(params)
Publish new content
ugc.update(params)
Update existing content
ugc.delete(id)
Delete content
ugc.like(id)
Like content
ugc.unlike(id)
Unlike content
ugc.report(params)
Report content (UgcReportParams)
Multiplayer
Every realtime multiplayer entry point requires authenticated_18plus. send and leave live on the ServerRoom returned by a gated entry point, so they inherit the gate transitively.
multiplayer.createRoom(roomType)
Create a realtime room
multiplayer.joinOrCreateRoom(roomType)
Join an open room, or create one
multiplayer.joinRoomByCode(code)
Join a room by its share code
multiplayer.matchmakeRoom(roomType)
Pair into a room via matchmaking
multiplayer.getUserRooms(options?)
List the caller's rooms
Error Handling
Gated methods throw AccessDeniedError when the user does not meet the required access tier. Catch it to show custom UI or fall back gracefully:
Last updated