Ultrahost/ docs

Auth is the block most callers will touch from React. The SDK owns redirects, refresh, and session state. Application code does not integrate each provider by hand.

Paths in the tables are relative to https://api.ultrahost.com/v1/projects/{projectId}. Pagination, idempotency, and errors are described in Conventions.

Create

Registration and invitations create identities. Provider configuration creates the federated path those identities can use.

Authentication

SDKRESTDescription
auth.signUp(data)POST /auth/signupRegister a user
auth.signIn(credentials)POST /auth/signinSign in with credentials
auth.signInWithProvider(provider)GET /auth/oauth/{provider}/authorizeStart federated sign-in
auth.resetPassword(email)POST /auth/password/resetRequest a password reset
auth.verifyEmail(token)POST /auth/email/verifyVerify an email address

Users

These methods are administrative. They belong on the admin client, not in a public browser bundle.

SDKRESTDescription
auth.users.list()GET /auth/usersList users
auth.users.get(id)GET /auth/users/{id}Retrieve a user
auth.users.create(data)POST /auth/usersCreate a user
auth.users.update(id, data)PATCH /auth/users/{id}Update a user
auth.users.disable(id)POST /auth/users/{id}/disableDisable an account
auth.users.delete(id)DELETE /auth/users/{id}Delete an account
auth.users.invite(email, options?)POST /auth/invitationsInvite a user

Providers

SDKRESTDescription
auth.providers.list()GET /auth/providersList identity providers
auth.providers.configure(name, config)PUT /auth/providers/{name}Configure a provider
auth.providers.disable(name)POST /auth/providers/{name}/disableDisable a provider

Configure

auth.providers.configure() stores the provider connection. Provider client secrets stay on the server. The browser only starts signInWithProvider() and receives a session.

Multifactor authentication is enabled per user with auth.enableMFA(config) (POST /auth/mfa/enable).

Password changes for the signed-in user use auth.updatePassword(data) (POST /auth/password/update).

Use

SDKRESTDescription
auth.signOut()POST /auth/signoutEnd the session
auth.refreshSession()POST /auth/refreshRefresh the session
auth.getSession()GET /auth/sessionCurrent session
auth.getUser()GET /auth/meAuthenticated user
tsx
const { user, loading, signIn, signOut } = useAuth();

Wrap the tree in UltrahostProvider. The companion hooks are useAuth(), useUser(), useSession(), and usePermissions(). Details are on the React page.