Prerequisites
You need a urBackend account and a MongoDB connection string (Atlas free tier works). The base URL for all API calls ishttps://api.ub.bitbros.in.
Create a project and get your API keys
Open the urBackend Dashboard and create a new project. During setup, you will provide your MongoDB connection string.Once the project is created, navigate to Settings to find your two API keys:
pk_live_...— your publishable key, safe to use in frontend and mobile code.sk_live_...— your secret key, for server-side use only. Never expose this in client code.
Create a collection in the Database tab
Collections must be registered in the dashboard before you can send data to them.
- Go to the Database tab in your project.
- Click Create Collection.
- Enter a name, for example
products. - Optionally define a schema (field names and types). You can also skip this and post arbitrary JSON — urBackend will store it as-is.
- Click Save.
/api/data/products.Insert a document using your secret key
Write operations require your A successful insert returns HTTP
sk_live key when called from a server. Send a POST request with a JSON body to insert a document.201 with the saved document, including its generated _id.What’s next?
You now have a working backend — collections, inserts, and reads are all live. A few natural next steps:- Add user authentication. The Auth API (
/api/userAuth/*) handles sign-up, login, JWTs, and social login. See the Authentication guide. - Let frontend users write data. Enable Row-Level Security on a collection so authenticated users can write their own documents with
pk_live. See Row-Level Security. - Enforce data shape. Define field types, required constraints, and unique fields in the collection schema. See Collections & Schemas.
To allow your frontend users to create or update documents without exposing your secret key, you need to enable Row-Level Security on the collection and have users authenticate first. The Authentication guide covers the full sign-up and login flow.
