Connect your React, Vue, Angular, or mobile apps to Mock API Builder with framework-specific examples
Mock API Builder provides standard HTTP APIs that work with any HTTP client. This guide focuses on REST. GraphQL clients should post to /api/graphql/{slug} — see the GraphQL guide and Choosing a Protocol for gRPC and SOAP URLs.
React, Vue, Angular, Svelte—works with all modern web frameworks
React Native, Flutter, Swift, Kotlin—native mobile integration
fetch, Axios, TanStack Query, SWR—use your preferred client
Redux, Zustand, Context API—integrate with any state solution
Use environment variables to easily switch between mock and production APIs:
Usage: process.env.NEXT_PUBLIC_API_URL
Usage: import.meta.env.VITE_API_URL
Usage: environment.apiUrl
Mock API Builder automatically includes the necessary CORS headers for all responses:
Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETEAccess-Control-Allow-Headers: Content-Type, AuthorizationNo additional configuration needed—calls from any domain will work.