Naming Convention for RPCs in Nakama Console

Hi all,

I’ve run into a small but possibly meaningful UX issue with how custom RPC function names appear in the Nakama Console UI.

In my module, I register RPCs like so:

function InitModule(ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, initializer: nkruntime.Initializer) {
    initializer.registerRpc('Admin_SetMaintenanceMode', rpcAdminSetMaintenanceMode);
    initializer.registerRpc('Admin_SetRequiredClientVersion', rpcAdminSetRequiredClientVersion);
    initializer.registerRpc('StartupHealthchecks', rpcStartUpHealthChecks);
    initializer.registerRpc('UpdateLastOnline', rpcUpdateLastOnline);
    logger.info('Javascript InitModule loaded');
}

The first argument of registerRpc() is the function’s ID, which is then visible in the Nakama Console under the RPCs tab. However, these IDs are transformed to lowercase, making them harder to read — especially when compared to the built-in RPCs like DeleteStorageObjects, which use PascalCase.

My question is:
:small_blue_diamond: Is there a way to preserve the original casing in the Console display?
:small_blue_diamond: Or is this automatic normalization by design?

Before filing a GitHub issue or feature request, I wanted to check here first in case there’s already a workaround or rationale behind this behavior.

Thanks in advance!

Hello @Mathijs-Bakker,

The RPC IDs are indeed normalized and will always be registered as lower-case, the original ID is not kept so there’s no way to display it in the Console.

Best.

1 Like

Ok, clear

So - for example - the id:

initializer.registerRpc('setrequiredclientversion', rpcAdminSetRequiredClientVersion);

could be labeled

initializer.registerRpc('set-required-client-version', rpcAdminSetRequiredClientVersion);

for readability.
(or whatever ‘best’ practice is used in the current project's style-guide).

Yes, using snake_case or dashes is allowed and can help with readability of the RPC IDs.

In addition to what @sesposito mentioned, note that RPCs are also used as URL endpoints, so typically URLs don’t contain dashes and aren’t case sensitive.

1 Like