spacetimedb-procedures
Installation
SKILL.md
Use this skill for procedures and server-side work that is not a reducer transaction entrypoint.
Core procedure patterns
Procedures are server functions that can return values and perform work that reducers should not do, including external HTTP calls. Use reducers for client-invoked transactional state changes; use procedures when the caller needs a return value or the function must do external work.
TypeScript procedure shape:
export const add_two_numbers = spacetimedb.procedure(
{ lhs: t.u32(), rhs: t.u32() },
t.u64(),
(_ctx, { lhs, rhs }) => BigInt(lhs) + BigInt(rhs),
);
Language notes: