social.plus SDK creates new users automatically through the login method. This seamless approach handles both new user creation and existing user authentication in a single operation.
The login method serves dual purposes: it creates new users when they don’t exist and authenticates existing users when they do.

How User Creation Works

When you call the login method:
  1. Existing User: If a user exists with the specified userId, the SDK logs them in and optionally updates their displayName
  2. New User: If no user exists with the userId, the SDK creates a new account and logs them in automatically

Parameters & Limits

User ID

Maximum 50 characters

Display Name

Maximum 100 characters

Implementation

Task { @MainActor in
    do {
        try await client.login(
            userId: "<user-id>",
            displayName: "<(optional)-display-name>",
            authToken: "<(optional)-auth-token>",
            sessionHandler: MySessionHandler()
        )
        print("login success")
    } catch {
        print("login failed \(error)")
    }
}

Next Steps