Docs
Building a custom frontend with Claude and the SDK
A practical workflow for building your own frontend on the Udghatan backend by prompting Claude with the @ab-ecosystem SDK docs and a starter repo.
The Udghatan SDKs ship their docs inside each npm package, and the starter repos are complete working apps. That combination suits AI-assisted development. This guide shows a practical workflow for building your own frontend by prompting Claude, Anthropic's AI coding assistant, with the SDK docs and a starter repo as context.
The package docs are the ground truth. Only use classes and methods documented in the installed package. The one call shown on this page, crm.contacts.list, is from those docs; everything else Claude writes should be checked against them.
The workflow at a glance
- Set up the project from a starter repo, or add the SDKs to your existing app.
- Write a context file that tells Claude which packages you use, where their docs are, and what rules to follow.
- Plan before coding. Ask Claude to read the starter repo and the package docs and propose a plan.
- Build in small steps, one screen or feature at a time.
- Review and test every change yourself before moving on.
- Harden for production using the going-live checklist.
Step 1: Set up the project
The quickest start is to fork the starter repo closest to your idea. The WhatsApp omnichannel inbox and CRM starter (React Native + Expo, MIT) already handles login with @ab-ecosystem/sso and talks to the backend through @ab-ecosystem/cpaas. Follow the setup steps on its page, run it, and confirm it works before asking Claude to change anything. Other repos are listed in the starter repo catalog.
Adding Udghatan to an existing app instead? Install the packages you need, for example:
npm install @ab-ecosystem/cpaas
The full list is in the SDK catalog. Use version control (such as Git) from the first minute and commit after every working step, so you can undo anything that goes wrong.
Step 2: Write a project context file
Claude works best when it knows the rules of your project. If you use Claude Code, a CLAUDE.md file at the root of your repository is read automatically at the start of each session. With other tools, paste the same content at the start of the conversation.
# Project: ClinicChat (our front desk app for clinics)
## What this is
A custom frontend built on the Udghatan backend, forked from the
WhatsApp Cloud API Omnichannel Inbox & CRM starter repo.
Udghatan runs auth, the CRM gateway, the live inbox and channels.
We build only the user interface and clinic-specific workflows.
## SDKs
- @ab-ecosystem/cpaas: channels, CRM contacts, campaigns,
templates, live inbox
- @ab-ecosystem/sso: login, 2FA, signup, account settings
- Docs ship inside each package in node_modules/@ab-ecosystem/
(README, JSDoc, reference pages). Read them before using an API.
- Never invent SDK classes or methods. If it isn't in the package
docs, ask me instead of guessing.
- Follow the existing patterns in this repo for auth and errors.
## Rules
- Never put secrets in client code. Calls that need a secret go
through our server.
- Business-initiated WhatsApp messages outside the 24-hour window
must use an approved template.
- Only message contacts who have opted in.
- Default sending speed is 10 messages per second. Respect it.
## Conventions
- [framework, folder layout, styling approach, test command]
The most useful line is "read the package docs; never invent SDK methods". Because the docs are installed with the package, Claude can always check the exact version you're using.
Step 3: Plan before coding
Read this repo and the docs in node_modules/@ab-ecosystem/cpaas and
node_modules/@ab-ecosystem/sso. Explain in plain language:
1. How the app signs users in and keeps the session
2. How it loads contacts and conversations, and sends a message
3. How errors are handled
Then propose a plan for a simplified "today's appointments" screen
for clinics. Don't write code yet.
Check the explanation against the code. If Claude has misunderstood how authentication works, fix that now, before it spreads into every screen.
Step 4: Build in small steps
One feature per prompt keeps changes reviewable.
Add a contact search box to the CRM screen. Use the CrmClient from
@ab-ecosystem/cpaas and crm.contacts.list with the search and rows
options, as documented in the package. Add loading, empty and error
states. Keep the change limited to this screen.
Add a "Send reminder" action to each appointment that sends our
approved appointment reminder template. Find the correct template
API in the @ab-ecosystem/cpaas docs first and tell me which one you
will use before writing code. Show success and failure messages.
Sending fails with the error below. Find the cause by reading the
package docs and our code, explain it, then propose the smallest fix.
[paste the full error and the relevant log lines]
Step 5: Review and test
You are responsible for what ships, so treat Claude's output like a pull request from a new team member.
- Read every diff. Look for methods that aren't in the package docs, hard-coded values and secrets.
- Run it on each platform you target (the starter repo runs on Android, iOS and web), using a test workspace and test numbers, not real customers.
- Test failure cases: no internet, expired session, rejected template, insufficient recharge balance, very long messages.
- Use the types. The SDKs are typed TypeScript clients. Keep type checking on; a type error often catches an invented method.
- Ask for tests on important logic, then check the tests actually test something.
Security essentials
Keep secrets server-side. Anything bundled into a web or mobile app can be read by users. Keep secrets in environment variables on your server, and follow the package docs and starter repo for how auth tokens should be obtained and stored.
- Never paste real tokens, customer data or phone numbers into prompts. Use placeholders.
- Add secret files such as
.envto.gitignore. - Check that each user only sees their own workspace's conversations and contacts.
- Check each package's licence before you ship; they are not all the same.
Next step
For a longer walkthrough, take the training lesson building your frontend with Claude. When your frontend works end to end, go through the going-live checklist.