Create Username
This guide explains to create a new username.
Username usage is regulated by Username Rules set on the desired username namespace contract. More information on this will be provided in due course.
First, check if the username is available in the target namespace (lens/ by default).
- GraphQL
- React
- TypeScript
Use the username query to fetch a username by local name and namespace (if different from lens/*).
If available, the query returns null.
Then, create the username.
- GraphQL
- React
- TypeScript
Use the createUsername mutation to mint the desired username.
You MUST be authenticated as Account Owner or Account Manager to make this request.
Finally, handle the result as explained in the Transaction Lifecycle guide.
That's it—you have successfully created a new username.