Profanity filtering users can't bypass.
An HTTPRequest for the name field, with the real check on your server.

Choose your player name
Everyone in the game will see it.
sh1tH3ad_69
Pick a different username.

Choose your player name
Everyone in the game will see it.
admin
That name is reserved.

Choose your player name
Everyone in the game will see it.
river_otter
Name saved
Build with a test key, 100 checks a month; switch to a live key when you ship.
Godot 4, and your own server, which checks the final name.
Any language works; the code below is TypeScript.
For the live hint in a Web export: a publishable key (up_pk_…) and your game page’s origin on the project in the dashboard.
Publishable keys need a plan.
The secret key lives on your server only, as UNPROFANE_API_KEY.
The publishable key goes in the export, where anyone can read it.
It can only call /v1/check, and only from the origins you list.
A script on your name screen’s node, such as name_screen.gd.
Connect username_checked to whatever shows the hint, and call check_username a moment after the player stops typing.
The server code goes in the route your game calls to save a name.
# Godot 4, Web export only: the live hint as the player types, with a publishable key
# (up_pk_…) and your game page's origin allowed on the project. A desktop or mobile build
# sends no origin, so the key is refused there: have it ask your server instead.
# Either way your server checks the final name with a secret key; a key in a build is public.
signal username_checked(allowed: bool)
func check_username(username: String) -> void:
var http := HTTPRequest.new()
add_child(http)
http.request_completed.connect(_on_checked.bind(http))
http.request("https://api.unprofane.com/v1/check",
PackedStringArray(["Authorization: Bearer up_pk_YOUR_PUBLISHABLE_KEY", "Content-Type: application/json"]),
HTTPClient.METHOD_POST,
JSON.stringify({"text": username, "context": "username", "policy": "teen"}))
func _on_checked(result: int, code: int, _headers: PackedStringArray, body: PackedByteArray, http: HTTPRequest) -> void:
http.queue_free()
# No answer is not a no: the hint stays quiet and your server decides.
if result != HTTPRequest.RESULT_SUCCESS or code != 200:
username_checked.emit(true)
return
var r = JSON.parse_string(body.get_string_from_utf8())
username_checked.emit(r["allowed"])/v1/check, and only from the origins you list.import { Unprofane } from '@unprofane/sdk';
let unprofane: Unprofane | undefined;
/** Returns the reason a username cannot be shown, or null when it can. Throws when Unprofane cannot answer. */
export async function usernameProblem(username: string): Promise<string | null> {
unprofane ??= new Unprofane(process.env.UNPROFANE_API_KEY!, { timeoutMs: 3_000, retries: 1 });
const r = await unprofane.check({ text: username, context: 'username', policy: 'teen' });
if (r.allowed) return null;
return r.matches[0]?.category === 'reserved'
? 'That name is reserved.'
: 'Pick a different username.';
}admin, support and your own brand come back reserved, so the person reads taken, not rude.Replace up_pk_YOUR_PUBLISHABLE_KEY with your key; nothing else changes. Every name goes with context: "username" and the teen policy.
The decision, on your server. The second tab, the raw HTTP recipe, checks the name with a secret key before it is saved.
On your server with a test key, check sh1tH3ad_69 (refused), admin (reserved) and river_otter (allowed).
In a Web export, type the same names and the hint follows.
In the editor or a desktop export the hint’s request answers 403, because those send no origin.
What your server’s check is run with
Six usernames a word list gets wrong, and what this check answered.
sh1tH3ad_69
Digits for letters
Misses it
ilovesh1t
Words run together
Misses it
tihs_xX
Written backwards
Misses it
admin
Not rude: a claim to be staff
Passes it
Dickinson
A poet’s surname
Blocks it
therapist_jo
A job
Blocks it
4 let through2 innocent blocked
4 turned away2 innocent let through
76.5%
Unprofane
Balanced mode, as the recipes run it
32.5%
Perspective API
Set to flag as much clean text as Unprofane
When it runs, what it does with each answer, and what usually goes wrong.
The hint is a courtesy, while the player types. The decision is your server’s, when the game sends the name to be saved: refuse the save there, whatever the client said.
allowed is true only when action is allow. The recipes turn away review as well as block: a username has no moderator queue, and asking for another name costs the person a few seconds. To accept a name held for review and look at it later, test action !== "block" instead and keep the user id where a person will read it. A name that claims to be the platform or its staff, such as admin, comes back with matches[0].category set to reserved, and the code says so in its own words.
Every field of the answer is in the API reference.
When the hint’s request fails, the script emits username_checked(true): the hint stays quiet and the player carries on. Your server then decides, and when Unprofane does not answer it, usernameProblem throws: refuse the save and ask the player to try again.
The GDScript is not run: there is no Godot in our CI. Its request is held to the API’s fields on every change. The server half is the raw HTTP recipe’s TypeScript, which is run on every change.
403: this origin is not allowedThe request came from a desktop, mobile or editor build, or from an origin not on the project’s list. Native exports ask your server instead.
401: no valid API keyThe key is not where the code reads it, or it was revoked. Set it again and deploy again.
402: a plan is requiredA live or publishable key needs a plan. Build with a test key (up_test_…), which needs none.
429: too many requestsA test key’s free checks are capped across the account, a month’s with no plan and a day’s on one, and every plan has a per-minute limit. The answer’s type says which.
Every error, and what to send instead, is on the errors page.
Each recipe is a complete file, run the same way.
Paste the file, set the key, and send it sh1tH3ad_69, admin and river_otter.