# Recommendation for temporary accounts solution

**URL:** <https://forum.heroiclabs.com/t/recommendation-for-temporary-accounts-solution/5642>\
**Category:** Local Setup\
**Tags:** authentication, sdk-godot\
**Created:** [September 17, 2024, 5:27am UTC](https://forum.heroiclabs.com/t/recommendation-for-temporary-accounts-solution/5642 "2024-09-17T05:27:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cramos73](https://avatars.discourse-cdn.com/v4/letter/c/779978/32.png) [@cramos73](https://forum.heroiclabs.com/u/cramos73)\
**Post date:** [September 17, 2024, 5:27am UTC](https://forum.heroiclabs.com/t/recommendation-for-temporary-accounts-solution/5642/1 "2024-09-17T05:27:00Z")

</div>

Hi,

First post here. I have a unique problem and I would like to hear what the best solution would be.

Requirements:  
I want to make a simple **web** game **with no authentication** and use Nakama for relayed matches using the Godot Client SDK bridge. I don’t want authentication and I want this to be a web game mainly for portfolio and prototyping purposes.

Problem:  
Currently in Godot 4, web exports [do not support the function OS.get\_unique\_id().](https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-get-unique-id) So when creating the session with device id, I generate my own ids. Basically this creates an account every time. This works but it is flooding the database.

I see this [old thread](https://forum.heroiclabs.com/t/temporary-accounts/2102) on temporary accounts. Would running a custom script on the database to delete the users be the solution here? How about a background job? I don’t see much documentation on background jobs.

Any help is appreciated. Thanks!

Setup:  
Nakama (docker self-host) ver: 3.23.0+1811efb0  
CockroachDB latest v23.1  
Client SDK: Godot latest (v3.4.0)  
Godot 4.3 stable

Cheers,  
Carlos

---

<div class="post-metadata">

**Author:** ![cramos73](https://avatars.discourse-cdn.com/v4/letter/c/779978/32.png) [@cramos73](https://forum.heroiclabs.com/u/cramos73)\
**Post date:** [September 20, 2024, 11:49pm UTC](https://forum.heroiclabs.com/t/recommendation-for-temporary-accounts-solution/5642/2 "2024-09-20T23:49:29Z")

</div>

Ok after a day or two of trying different things. I decided with making a nakama runtime module and using the function sqlExec() to run sql code on the cockrachdb. Now I can make a sever to server call with the curl command every day ([example here](https://heroiclabs.com/docs/nakama/server-framework/runtime-examples/#server-to-server)) using a cron job.

Here is that code for anyone that is interested:

```auto
let InitModule: nkruntime.InitModule =
	function(ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, initializer: nkruntime.Initializer)
	{
		initializer.registerRpc('deleteallusers', rpcDeleteAllUsers);
		logger.info("RPC modules Initialized.");
	}

function rpcDeleteAllUsers(ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, payload: string): string
	{
		if (ctx.userId)
		{
			logger.error("RPC was called by a user.");
			return "";
		}
		logger.info("rpcDeleteAllUsers called.");
		let query = 'DELETE FROM users';
		let result: nkruntime.SqlExecResult;
		try
		{
			nk.sqlExec(query, []);
		} catch(error)
		{
			logger.error("rpcDeleteAllusers: Failed running query.", error);
			return JSON.stringify({ success: false });
		}
		return JSON.stringify({ success: true });
	}

```
