- What is goldnead/statamic-app-api and what problem does it solve?
- It is a Statamic addon that exposes your content as a clean, app-ready JSON API so iOS, Android and other custom clients can consume entries, taxonomies and global data. Instead of hand-rolling controllers for every screen, you configure which collections and fields are published and the addon handles routing, serialization and access control. It is built for headless Statamic setups and respects your existing blueprints while keeping responses lean and predictable for mobile consumption.
- How do I install goldnead/statamic-app-api in a Statamic project?
- Install it with Composer from your Statamic project root using the package name goldnead/statamic-app-api, alongside Statamic and Laravel. Because it is a Statamic addon, it registers its own routes and services, so you do not need to wire up controllers manually. Check the repository README for the exact command and any post-install configuration steps that apply to your Statamic version.
- How do I control which collections and fields are published by the API?
- The addon is configuration-driven: you declare which collections and taxonomies get endpoints and which blueprint fields are exposed. Field filtering means only the fields your app actually needs are serialized, so payloads stay small and you avoid leaking internal fields by accident. Since it reads Statamic's native content model, edits made in the control panel flow through without changing any API code.
- How does token-based authentication work for API requests?
- Client requests are authenticated with a token, so mobile apps and other consumers can reach the endpoints without making your content publicly readable. Access control for those tokens is handled by the addon rather than by middleware you write yourself, which keeps the integration small. In production, always serve the API over HTTPS and issue a separate token per client so revocation stays straightforward.
- Which Laravel and Statamic versions does goldnead/statamic-app-api support?
- It is a Statamic addon, so it requires Statamic running on Laravel; the exact supported constraints are declared in the package's composer.json and should be checked before you upgrade either framework. Statamic majors occasionally change internal APIs, so pin the addon version and read the changelog when moving to a new Statamic or Laravel release. Validating on a staging copy first is the safest way to confirm compatibility before touching production.
- Can the API expose taxonomies and global data, not just collection entries?
- Yes. Endpoints can be configured per taxonomy as well as per collection, so terms and their related entries are available to your clients in the same style as collection entries. Site-wide global data can also be exposed, which saves app screens from making several calls just to fetch shared values such as settings or contact details. Field filtering applies here too, so taxonomy and global payloads stay limited to what the app actually renders.
- Are the API responses cache-friendly for mobile clients?
- Responses are designed to be lean and predictable, with sensible caching defaults, which matters for mobile clients on slow or metered connections. Because payloads contain only the fields you publish, they sit comfortably behind an HTTP cache or CDN. If content freshness is critical for your app, review the cache settings and make sure publishing an entry invalidates or expires what clients have cached.
- How should I test the API endpoints in my Laravel application?
- Exercise the endpoints with any HTTP client, or write Laravel feature tests that send an authenticated request and assert the JSON structure. Testing against the published field list is a good guard against accidentally exposing a new blueprint field after an editor adds one. Include a test for requests with a missing or invalid token to confirm the API returns an error instead of content.
- How does this compare with Statamic's built-in REST API or custom controllers?
- Compared with Statamic's built-in REST API or hand-written Laravel controllers, this addon is opinionated toward app consumption: per-collection and per-taxonomy endpoints, token authentication and field filtering are configured rather than coded. That removes a lot of boilerplate if you want lean, predictable payloads for iOS and Android clients. It is not a general-purpose query layer, so if you need arbitrary filtering or full GraphQL-style flexibility, check whether the configuration surface covers your cases before adopting it.
- Is goldnead/statamic-app-api safe to run in production, and how is it maintained?
- It is a small, focused addon layered on Statamic's content model, so the main risks are version drift with Statamic and Laravel and how quickly the maintainer tracks upstream changes. Pin the version in composer.json, watch the repository for recent releases and open issues, and keep an integration test on your endpoints so upgrades surface breakage early. Treat API tokens as secrets, rotate them if a client is compromised, and keep the addon and Statamic patched together.