Anonymous Sign-in
Create an Abrova Auth user with one call and no sign-in screen. The user gets a stable id and a user token for every Abrova product, and can link Apple, Google or a password later.
One call creates a user with a random id and signs the device in. There is no screen and nothing to type. Only this device holds the session, so treat the user as a guest until they link a sign-in method.
Turn it on#
In Abrova Console, open Abrova Auth › Sign-in methods and turn on Anonymous. Optionally set a lower daily limit for new anonymous users under Abrova Auth › Settings › Anonymous users.
Sign in#
Sign in only when nobody is signed in yet. The SDK restores the saved session at start, so the same guest comes back on the next launch.
// Flutter
final auth = AbrovaAuth.instance;
if (auth.currentUser == null) {
await auth.signInAnonymously();
}// iOS
if AbrovaAuth.shared.currentUserId == nil {
try await AbrovaAuth.shared.signInAnonymously()
}// Android
if (AbrovaAuth.shared.currentUserId == null) {
AbrovaAuth.shared.signInAnonymously()
}// Web and React Native
await auth.ready(); // the saved session is loaded
if (!auth.isSignedIn) {
await auth.signInAnonymously();
}On Flutter, signInAnonymously() returns the current user when an anonymous user is already signed in on the device.
Upgrade later#
Link Apple, Google or an e-mail and password to the anonymous user when they want to keep their account. The id stays the same:
await AbrovaAuth.instance.linkPassword(email: email, password: password);
See Anonymous users & upgrading for what happens when the account already exists.
Limits#
| Limit | Value |
|---|---|
| New anonymous users per day | 200 per project, or your own lower limit |
| From one address | A burst of new users from one address is slowed down |
| Removed when unused | After 90 days without a sign-in or renewal (7 to 3,650, in Settings) |
Over a limit, the call fails with RATE_LIMITED. Each new anonymous user who uses the app counts as a monthly active user, like any other user.
Errors#
| Code | Meaning |
|---|---|
| METHOD_DISABLED | Anonymous sign-in is off for the project. |
| RATE_LIMITED | Too many new anonymous users: per address, or the daily limit. Try again after retryAfterSec. |
| MAU_LIMIT | This month’s free 1,000 monthly active users are used up and the wallet has no balance to pay for more. |