Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Kratos Client Php Laravel Package

ory/kratos-client-php

The official PHP client for Ory Kratos, the open-source identity and user management server. Generated from Ory's OpenAPI spec, it gives Laravel and PHP apps typed access to Kratos APIs for registration, login, sessions, and account recovery.

Deep Wiki
Context7

Technical Evaluation

Architecture fit: ory/kratos-client-php is best treated as a PHP API client for Ory Kratos, not as a complete Laravel authentication package. It can fit an architecture where Kratos owns identity, registration, login, MFA, social login, and session lifecycle, while Laravel remains the business application. It will not, by itself, provide Laravel guards, middleware, Blade/UI flows, migrations, or local user models. TPM leverage is therefore highest when Ory Kratos is already a strategic identity platform and the team is prepared to build a thin Laravel adapter around the client.

Integration feasibility: Feasible for server-side calls to Kratos public/admin APIs, but not a drop-in replacement for Laravel Breeze, Jetstream, Sanctum, or Fortify. Browser-based flows need careful handling of redirects, cookies, CSRF, CORS, and session validation. The package likely needs a Laravel service provider or wrapper, configuration management, DTO/error mapping, and observability. Repository provenance is unknown, and 15 stars with a 0.355 score signals low adoption and limited production evidence; Apache-2.0 reduces legal risk but does not reduce maintenance or API-drift risk.

Technical risk: Main risks are generated-client maturity, lag against Kratos OpenAPI changes, incomplete coverage of admin vs. public APIs, poor Laravel ergonomics, session/cookie misconfiguration, and unclear maintainer responsiveness. Security-sensitive admin API keys must never leak to the browser. Identity migration, password-hash compatibility, multi-tenant modeling, webhook reliability, and rate limits need explicit design. The client should not become the sole source of authorization truth without a clear session-validation strategy.

Key questions: Is this package official, generated, or community-maintained? Which Kratos/OpenAPI version does it target? Does it cover current public and admin endpoints, session whoami, MFA, social login, and identity schema APIs? Which PHP/Laravel versions and PSR-18/Guzzle dependencies are supported? Is it compatible with Ory Network and self-hosted Kratos? How are API errors, retries, timeouts, and rate limits handled? What is the maintenance cadence and security disclosure process? Does the team need to fork or regenerate the client?

Integration Approach

Stack fit: Best fit is Laravel 10/11 on PHP 8.x with a separate Kratos deployment or Ory Network. Use the package inside a dedicated Laravel service layer, with config for Kratos base URL, admin credentials, public credentials, timeout, and retry policy. Map Kratos identity IDs to local application user records rather than replacing the Laravel user model wholesale. For browser login, prefer Kratos-hosted flows or a controlled custom UI; use the PHP client for backend orchestration and admin operations.

Migration path: Start with a non-production proof of concept covering one flow, such as admin user provisioning or session validation. Then add public login/registration flows, MFA, and social login. If migrating from Laravel-native auth, define an identity import and password strategy before cutover. Run Kratos and the existing auth path in parallel where possible, with feature flags and per-environment rollout. Avoid a big-bang replacement of Laravel auth until session validation, user mapping, and rollback are proven.

Compatibility: Pin the package version and the Kratos version together. Validate supported PHP/Laravel ranges, PSR-18/Guzzle compatibility, and endpoint coverage against the target Kratos OpenAPI spec. Confirm cookie domain, SameSite, CSRF, CORS, and callback URL behavior in staging. If the client is incomplete or stale, budget to regenerate or wrap missing endpoints rather than patching vendor code ad hoc.

Sequencing: First verify package provenance and license headers. Second, build a Laravel wrapper with configuration, exception mapping, logging, and tests. Third, integrate admin API user provisioning and identity mapping. Fourth, integrate public login/session flows and middleware. Fifth, add MFA/social login and webhook-based synchronization. Finally, cut over behind feature flags with rollback to the prior auth path.

Operational Impact

Maintenance: Expect ongoing ownership. A low-star generated client may lag Kratos releases, so the team should monitor OpenAPI changes, pin versions, and be ready to regenerate or fork. Assign an owner for dependency upgrades, security patches, and endpoint coverage.

Support: Ory may support Kratos/Ory Network commercially, but support for this specific PHP client is likely community-only or unclear. Internal runbooks and vendor escalation paths must distinguish identity-platform support from client-library support.

Scaling: The client itself is stateless and should scale with the Laravel application, but every auth decision adds network dependency on Kratos. Avoid caching sensitive session or authorization decisions without a deliberate design. Watch Kratos rate limits, connection pooling, timeout budgets, and admin API usage during bulk provisioning.

Failure modes: Kratos unavailability can block login and session validation. Misconfigured cookies, redirect URLs, CORS, or CSRF can cause intermittent browser failures. Admin key leakage, webhook delivery loss, API schema drift, generated-client serialization bugs, and unmapped errors are also material. Build health checks, structured logs, alerting, and graceful degradation where appropriate.

Ramp-up: The team needs Ory Kratos concepts: identity schemas, self-service flows, sessions, courier, MFA, and admin/public API separation. Budget one to two sprints for a Laravel adapter, POC, security review, and runbooks. TPM recommendation: conditional go only if Ory Kratos is already strategic; otherwise treat this package as a low-maturity SDK and evaluate the official Ory tooling or a maintained Laravel integration first.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
unabomber/timezone
delatbabel/contacts
astritzeqiri/g-recaptcha
kevinongko/laravel-genode
developeruz/laravel-analytics
robbiep/afterthedeadline
frankkessler/incontact-laravel-oauth2-rest
jlxh/laravel-userlog
davidmgilo/timetables
qylinfly/role-permission
reflect-digital/conduit
takashato/laravel-vietqr
aitor24/laralang
kraenzle-ritter/entity-relations
dindigital/din-image
pomirleanu/image-colors
sawmainek/laravel-api-generator
delatbabel/jsonresponses
mouhamedfd/permissions-generator
eduplus/qr