users module provides server-side access to user profiles, social graph data (follows and connections), and username availability. All operations use your project API key and do not require a user access token.
fetchUserById
Fetches a user profile by their internal Replyke user ID.The Replyke user ID.
Promise<User>
fetchUserByForeignId
Fetches a user profile by your application’s own user identifier. Optionally creates the user if not found.Your application’s user identifier.
When
true, creates the user with the provided profile fields if no match is found. Defaults to false.Display name — used only when creating a new user.
Username — used only when creating a new user.
Avatar URL — used only when creating a new user.
Bio text — used only when creating a new user.
Public metadata — used only when creating a new user.
Secure metadata (not exposed to the client) — used only when creating a new user.
Promise<User>
fetchUserByUsername
Fetches a user profile by their username.The user’s unique username.
Promise<User>
updateUser
Updates a user’s profile fields.The Replyke user ID to update.
New display name.
New username. Must be available.
New bio text.
New avatar URL.
Updated public metadata. Merged with existing metadata.
ISO 8601 date string for the user’s birthdate.
Geographic location
{ latitude: number; longitude: number }.Promise<UserFull>
fetchUserSuggestions
Returns users whose name or username matches a partial query string. Useful for mention autocomplete on the server.Partial name or username to search for.
Maximum number of results to return.
Promise<User[]>
checkUsernameAvailability
Checks whether a username is available for registration.The username to check.
Promise<{ available: boolean }>
fetchFollowersByUserId
Returns a paginated list of users following the specified user.The Replyke user ID.
Page number (1-indexed). Defaults to
1.Results per page. Defaults to
20.Promise<PaginatedResponse<User>>
fetchFollowersCountByUserId
Returns the total number of followers for a user.The Replyke user ID.
Promise<{ count: number }>
fetchFollowingByUserId
Returns a paginated list of users that the specified user is following.The Replyke user ID.
Page number (1-indexed). Defaults to
1.Results per page. Defaults to
20.Promise<PaginatedResponse<User>>
fetchFollowingCountByUserId
Returns the number of users the specified user is following.The Replyke user ID.
Promise<{ count: number }>
fetchConnectionsByUserId
Returns a paginated list of established mutual connections for a user.The Replyke user ID.
Page number (1-indexed). Defaults to
1.Results per page. Defaults to
20.Promise<PaginatedResponse<EstablishedConnection>>
fetchConnectionsCountByUserId
Returns the number of established connections for a user.The Replyke user ID.
Promise<{ count: number }>
