In This Section
Built-in Auth
Register and sign in users with email and password. Replyke manages the credentials, tokens, and password reset flow.
External Auth
Bring your own auth system. Sign a JWT with your project’s private key and exchange it for Replyke tokens.
OAuth
Let users sign in with Google, GitHub, Apple, or Facebook using a redirect-based OAuth 2.0 flow.
Multi-Account
Allow users to be signed into multiple accounts simultaneously and switch between them.
Token Model
Replyke uses a two-token system:- Access token — A short-lived JWT (30 minutes) included in API requests as a
Bearertoken. The SDK manages this automatically and refreshes it in the background. - Refresh token — A long-lived JWT (30 days) used to obtain new access tokens. Stored locally by the SDK’s AccountManager. Refresh tokens rotate on every use; reuse of a revoked token invalidates the entire session family.
useAuth hook exposes them if needed for advanced use cases.
Core Hook
TheuseAuth hook is the primary interface for authentication state and actions:
initialized is false until the SDK has attempted to restore a session from
the stored refresh token. Always check initialized before rendering
auth-dependent UI.
