API Maker
The backend engine for the AI era
Web and mobileEpisode 68 8:20 14 chapters November 2026
A real web shop in plain JavaScript calls API Maker from the browser: the token of the app from a public custom API (the password stays in the secret), pages of products with select, sort, limit, skip and the total, a customer who signs in for a token of their own, an expired token refreshed without the customer noticing, errors shown under their fields, allowed origins, types from the schemas, and the same calls from Swift and Kotlin.
In the playlists Start here The complete course Generated APIs
Your APIs can be called from a web page, and from a phone. Here is the web shop of Calm Home, in plain JavaScript. You see the token of the app, pages of products, a customer who signs in, a token that expires, errors under their fields, and the sites that are allowed to call.
An app usually waits for its backend. An endpoint is written for every screen. Tokens are signed, checked, and refreshed by hand. CORS is set up in every service. The error format changes from one endpoint to the next. And types are copied into the frontend by hand. With API Maker, the APIs are there as soon as the tables are. One token API gives and refreshes every token. Every answer has the same shape.
And the types come from the schemas. In this video: an API user for the app, its token, pages of products, a customer who signs in, a token that expires, errors under their fields, allowed origins, types, files, and live data, and the same calls from a phone.
The shop is one HTML page, on its own address. It has no framework and no build, only fetch. It calls API Maker, on another address. It reads the products of MongoDB, the orders of MySQL, and the custom API Cart Quote, from video fifteen. At the bottom of the page, you see every call it makes: its address, the tokens it carries, and its status.
An app calls API Maker as an API user. Open API User Permissions. Here is Shop app, with the user name shop_app. Its password is a key of the default secret, and it has one group. Open Security, then API Group Permissions, and the group Shop app. It has two instances, two databases, and two tables. On products, it has one API: Get all. And it has one custom API: Cart Quote.
Shop Token, below it, is public, so it needs no group.
A web page cannot keep a secret, because anyone can read what it holds. So the password of the app stays on the server. Shop Token is a public custom API. It reads the password from the secret, and asks for a token of shop_app. Here it lasts forty five seconds, so we can see it expire. By default, it lasts three days. The page calls Shop Token once, then sends the token in x-am-authorization, on every call.
The page opens. Its first call is Shop Token. It gets two hundred, and the token of the app. Then it gets the first page of products, with that token: six of thirty six. Click Next, for the second page. A page of products is one GET, with its query. select asks for the name, the price, and the category, and the id comes with them. sort orders them by name.
limit gives six rows, and skip jumps over the rows of the pages before. With getTotalCount, the answer brings totalCount, thirty six, next to the rows. So there are six pages.
Now a customer. Kabir types his email, and his password. He signs in. The token API, with the name of the auth provider customer_login, checks them, and gives the token of the person. Then the page reads his orders, with both tokens. The row scope from video twenty six keeps only his, and a post-hook writes their status in words.
Forty five seconds later, the token of the app has expired. Next gets four hundred and one. The page sends its refresh token to the token API, and gets a new token. It calls again, and gets two hundred. The customer sees nothing. One function of the page does this, for every call.
The cart is priced by Cart Quote. Try a quantity of zero, and an email without its domain. Get the price. We get four hundred, with every error in one answer, each with its field: email, and items dot quantity. The page puts each message under the input of its field. Now two lamps, the right email, a coupon, and get the price. We get the subtotal, the discount, the shipping, and the total.
The page and API Maker are on two addresses. For the browser, these are two origins. Before a call that carries a token header, the browser asks first, with OPTIONS. API Maker answers: any origin, these methods, and the headers asked for. So the calls go through, from any site, and the tokens decide what each one can do. To let only your own sites call, open Operations, then Sandbox Settings, and Allowed Origins.
Click Add New, type the address of the shop in production, and Save. From then on, a page on any other address gets four hundred and three, before anything runs. Like this page, here. A server or a phone app sends no origin, so the list does not apply to them. It keeps the pages of other sites away from your APIs.
In a TypeScript app, the types come from the schemas too. Generated Interfaces has an interface for every table, and IProducts for the products of the catalog. Download the file, and save it in the app with the extension d.ts. Pick the fields that the page selects, and the compiler checks every row the page reads. A file works the same way: a FormData with a field named files, sent with fetch.
Set no content type. The browser writes it, with its boundary. Import Stock, from video sixteen, checks the file before its code runs. A PDF gets four hundred. And live data is one WebSocket on the port of the APIs, with the same two tokens. Video twenty two shows it.
A phone app makes the same calls, with the same tokens. In API Testing, pick the instance mongodb, the database catalog, the table products, and Get all. The Integrations tab writes this call in your language. It knows dozens of languages and libraries. For iOS, pick Swift, with URLSession. And for Android, pick Kotlin, with OkHttp. The real token goes where the word token is.
Here are good habits, for every app. The password of an API user stays in the secret, never in an app. A public custom API hands out its token. Use one API user for each app, with a group as small as its screens. What belongs to a person needs the token of that person, and a row scope. Put your own sites in Allowed Origins. And put HTTPS in front of the server, as video sixty one shows.
To sum up. An app is an API user, with a small group. Its token comes from a public custom API, so the password stays in the secret. Pages use select, sort, limit, skip, and the total. A person signs in for their own token. A four hundred and one is answered with the refresh token. Every error comes with its field. And Allowed Origins lists your sites. Next: find your way around the panel.
API Maker. Build faster, spend smarter, deliver better.
Length 4:21Panel tour
Length 6:35Quick start
Length 6:54Authorization
Length 8:30Auth providers