- What is dystcz/lunar-api and when should I use it?
- dystcz/lunar-api is a presentation-layer API package for Lunar, the Laravel e-commerce platform, built around JSON:API. It exposes Lunar's Eloquent domain such as products, variants, carts, orders, customers, pricing, and media through configurable endpoints. Use it when Lunar is already your commerce engine and you need a headless API edge; it has near-zero value without Lunar.
- How do I install dystcz/lunar-api in a Laravel app?
- Install it with Composer alongside an existing Lunar installation; the package uses standard Laravel service provider auto-discovery and configurable route prefix and middleware. Publish the configuration, mount the routes under your chosen prefix such as /api/v1, and wire authentication and CORS. The hard part is agreeing the JSON:API resource schema and include graph with client teams, not the install itself.
- Which Laravel and Lunar versions does dystcz/lunar-api support?
- The evaluation points to PHP 8.x, Laravel 10/11, and Lunar 1.x as the expected stack, but it does not provide a published compatibility matrix. Because the upstream is read-only, pin exact versions of Lunar, this package, and the JSON:API serializer in composer.lock. Run contract tests against each Lunar minor you intend to support and treat every Lunar upgrade as a manual compatibility review.
- What authentication does dystcz/lunar-api use for storefronts and customers?
- Authentication is not confirmed in the provided evaluation; it is configurable through middleware but may not ship a specific guard. You should wire your chosen model, whether Sanctum, Passport, or a custom guard, and verify token issuance, refresh, and guest access. Treat auth as a host-application integration until the package documents it.
- Does dystcz/lunar-api support guest carts and token refresh?
- Guest carts and token refresh are flagged as open questions, not confirmed features. The package exposes carts and customers, but you must validate guest cart merging, token lifetime, and refresh behavior against your Lunar setup. Do not assume these flows work out of the box in production.
- What endpoints does dystcz/lunar-api expose?
- It exposes Lunar's Eloquent domain through JSON:API endpoints, including products, variants, carts, orders, customers, pricing, and media. Coverage beyond catalog and cart, such as checkout, payment intents, inventory reservation, and promotions, is uncertain from the evaluation. Verify the actual endpoint list before committing to a storefront flow.
- Is dystcz/lunar-api actively maintained?
- Treat dystcz/lunar-api as read-only or archived unless you can prove otherwise; the READ ONLY designation implies no issue triage, no PRs, no roadmap influence, and no guaranteed patches for Lunar security releases. The community is thin and effectively single-vendor. Confirm upstream ownership and patch SLA before production, and do not build differentiation on top of it.
- Does it support JSON:API features like sparse fieldsets, includes, filters, and pagination?
- Yes, the package uses JSON:API serialization with sparse fieldsets, includes, filters, pagination, and JSON:API error objects. That supports contract-driven clients and predictable response shapes. Pagination defaults and include-depth caps still need to be set and enforced at the host or gateway layer.
- What production concerns should I address before using dystcz/lunar-api?
- Mount the API behind your existing gateway or WAF and auth middleware, then define rate limits, CORS, API versioning, deprecation policy, pagination defaults, and include-depth caps. Test with production-like catalog volume and measure query counts per request. Because the upstream is read-only, every Lunar upgrade is a potential breaking change requiring manual compatibility review and a rollback plan such as per-resource feature flags.
- How should I test or contract-test dystcz/lunar-api?
- Check in a JSON:API schema or fixtures and validate response shapes against the spec, then run the package's contract tests in a CI matrix for each Lunar minor you support. If no published OpenAPI artifact exists, capture fixtures from staging and contract-test against those. Use per-resource feature flags so rollback is a routing change rather than a deploy.