Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ub.bitbros.in/llms.txt

Use this file to discover all available pages before exploring further.

GET /api/userAuth/me

Returns the full profile of the currently signed-in user. The response never includes the password field.

Required Headers

HeaderValue
x-api-keyYour pk_live_… key
AuthorizationBearer <accessToken>

Response Fields

_id
string
MongoDB ObjectId of the user.
email
string
The user’s email address.
name
string
The user’s display name.
...additional fields
any
All other fields from your users collection schema, except password.

Code Examples

const res = await fetch('https://api.ub.bitbros.in/api/userAuth/me', {
  headers: {
    'x-api-key': 'pk_live_YOUR_KEY',
    'Authorization': `Bearer ${accessToken}`
  }
});

const user = await res.json();

Success Response

{
  "_id": "64fd1234abcd5678ef901234",
  "email": "alice@example.com",
  "name": "Alice",
  "username": "alice_dev"
}

Errors

StatusCause
401 UnauthorizedMissing or expired Authorization token

GET /api/userAuth/public/:username

Returns a public-safe view of a user’s profile. No authentication is required.
This endpoint never returns sensitive fields such as password or email. Only fields considered safe for public display are included.

Path Parameters

username
string
required
The username of the user whose public profile you want to retrieve.

Required Header

x-api-key: your pk_live_… key.

Code Example

const res = await fetch('https://api.ub.bitbros.in/api/userAuth/public/alice_dev', {
  headers: {
    'x-api-key': 'pk_live_YOUR_KEY'
  }
});

const user = await res.json();

Success Response

{
  "_id": "64fd1234abcd5678ef901234",
  "name": "Alice",
  "username": "alice_dev"
}

Errors

StatusCause
404 Not FoundNo user found with that username