create

abstract suspend fun create(name: String): ApiKey

Creates a user API key that can be used to authenticate as the user. The value of the key must be persisted at this time as this is the only time it is visible. The key is enabled when created. It can be disabled by calling the disable method.

Return

the new API key for the user.

Parameters

name

the name of the key

Throws

if an invalid name for the key is sent to the server.

for other failures that can happen when communicating with App Services. See AppException for details.