expo-starter-pack is an Expo starter template: a typed data layer, an auth-gated dashboard, a UI kit and a mock backend, already wired together so a new app starts from a working architecture. The SDK 58 update is out, and it changes a lot. This post covers what the starter is and everything that's new in this release.
Start a project from the template
npx create-expo-app my-app --template @amirgazerani/expo-starter-pack cd my-app cp .env.example .env npm install npm run mock # terminal 1: mock API on port 4010 npx expo start # terminal 2: the app In .env, set EXPO_PUBLIC_API_DEV_URL to http://<your-LAN-IP>:4010 so a physical phone can reach the mock. GitHub's template button also works: gh repo create my-app --template amirazerani-gif/expo-starter-pack --clone --private. I explained why I built it in an earlier post.
What's in the starter
The networking is one openapi-fetch client whose request and response types are generated from your OpenAPI spec, so no API type is written by hand. Server data lives in TanStack Query, with one hooks file per API resource, and Zustand holds app and UI state only, like the auth token. Auth keeps the token in SecureStore, a guard protects the (dashboard) group, and an authenticated 401 signs the user out and clears the cache. Failed requests go through one ApiError type and one error store and show up as toasts, with flags on a hook for screens that show errors inline. A local mock server runs the demo API, so the whole app works before a real backend exists.
That's the base. This is what changed in the SDK 58 release.
Expo SDK 58 and React Native 0.88
The starter now runs on Expo SDK 58 with React Native 0.88, React 19.3 and the New Architecture, with expo-router's typed routes. If you're still on SDK 57, that version stays available on GitHub under the sdk-57 tag.
Generate TanStack Query keys and mutations from the OpenAPI spec
A commenter on r/expo suggested this: since the spec already knows every method and path, the query keys can come from it instead of hand-written key factories. That's how the starter works now, using openapi-react-query.
Before, each resource had a factory I had to keep in sync with the backend:
export const itemKeys = { all: ["items"] as const, lists: () => [...itemKeys.all, "list"] as const, detail: (id: number) => [...itemKeys.all, "detail", id] as const, }; Now keys and query options are derived from the method and path, and a create mutation looks like this:
export function useCreateItem() { const queryClient = useQueryClient(); return $api.useMutation("post", "/v1/items", { onSuccess: () => queryClient.invalidateQueries({ queryKey: $api.queryOptions("get", "/v1/items").queryKey, }), meta: { skipGlobalError: true }, }); } I invalidate with the same call I fetch with, and the mutation variables are the request itself: mutate({ body, params }). When the backend renames a field, I regenerate the types and TypeScript lists every call that broke. I wrote up the details of how this works here: [LINK TO THE HASHNODE ARTICLE]
Some mutations still need to shape the request, so writing them by hand stays supported, with the same conventions. Login is the example: it adds the device name and stores the token, which $api.useMutation can't express:
export function useLogin() { return useMutation({ mutationFn: async (body: JsonBody<"/v1/auth/login", "post">) => unwrap( client.POST("/v1/auth/login", { body: { device_name: DEVICE_NAME, ...body }, }), ), onSuccess: (session) => useAuthStore.getState().setSession(session.token), meta: { skipGlobalError: true }, }); } The rule is simple: if the screen can pass the request as it is, use $api.useMutation. If the hook adds or changes something, write it by hand. The typing and the error handling are the same either way.
A complete Expo UI kit
The UI kit is the biggest visual change. It now has 15 components: buttons (solid, outline, ghost and gradient), inputs, text areas, switches, checkboxes, radio groups, chips, badges, avatars, cards, dropdowns, modals and toasts. Modals come as center, bottom sheet, fullscreen and side drawer.
What matters more is that everything a component used to decide for itself is now set in one place:
- Theme. Colors, radius and spacing live in one tokens file, with light and dark mode picked from the device. To rebrand the app, you edit that file.
- Typography. One file controls fonts. You list your font files, map them to the four weights (regular, medium, semibold, bold), and pick a default family. You can define several families, and body text, button labels and field labels each get their own default weight. Changing the font of the whole app is one setting, and no component names a font.
- Sizes. Every control shares one scale (sm, md, lg), so a md button and a md input are the same height. The numbers live in one file, so making the whole kit a bit bigger is one edit, and any single component can still override its size.
I also replaced sonner-native with an in-app toast. It's a small store, so toast.error() works from anywhere and not only inside components. It supports swipe to dismiss, a countdown bar and deduplication, and modals mount their own toast host so toasts show above them.
An Expo starter that documents itself
The Home tab documents every component with its props, an import line and live variants. The Data tab explains the networking, mutations, how the token is stored and how errors are handled. A demo dashboard shows an infinite list, create and delete, and a profile form with inline validation errors, and each section names the file it's built from.
When you start a real project, you remove all of it:
npm run strip-example -- --dry-run # preview, changes nothing npm run strip-example # strip it, type-checking before and after The script deletes the example folders and any API resource nothing imports afterwards, leaves a Hello world home screen and an empty dashboard under the same auth guard, and removes the Data tab. It shows the full plan and asks first, and it won't run unless your git working tree is clean.
Published on npm
The starter is now an npm package, @amirgazerani/expo-starter-pack, so create-expo-app --template can start a project directly. The GitHub template button still works too.
Requirements and what it assumes
You need Node 22.13 or newer, and an iOS simulator, an Android emulator or a device with a development build. For Android native builds you also need JDK 17 and ANDROID_HOME set.
The template assumes a Laravel-style JSON API ({ message, data } envelopes, meta pagination, 422 validation errors). If yours is different, the README lists the files to change. The dashboard has route groups and a guard but no role logic, so if your backend has roles, you read the role from the user query and redirect. The mock backend returns canned responses and stores nothing.
Links
If you try it, tell me how it goes. If you like it, a star on the repo helps. If you have a suggestion, open an issue.
