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

Product Decisions This Supports

  • Identity roadmap: build vs. buy. Adopting Ory Kratos shifts authentication from "we build it" to "we integrate it." This client is the concrete integration artifact for a PHP/Laravel backend, so it directly informs whether SSO, MFA, passwordless, social login, account recovery, and profile/consent management ship on our timeline or on a vendor's.
  • Consolidating auth across multiple apps/services. If the portfolio includes more than one Laravel app, Kratos can act as a shared identity plane and this client becomes the per-app connector — a real architectural decision, not just a library choice.
  • Headless / API-first product bets. Products where the backend is the system of record for sessions (mobile apps, SPAs, partner APIs) fit Kratos' flow-based, API-driven model; this client is what makes that model usable from PHP server-side code.
  • Coexistence and migration sequencing. It enables a phased approach — run Kratos alongside existing Laravel guards (Fortify/Sanctum) and migrate flows incrementally, rather than a risky big-bang auth rewrite.
  • Compliance-driven scope. GDPR-style account deletion/export, consent tracking, and session governance are identity-server concerns; the client determines how cheaply those capabilities can be surfaced in the product.
  • Not a decision driver for: authorization/policy (that's a separate concern, e.g., Ory Keto or app-level policies), billing, or user-profile product features beyond identity attributes.

When to Consider This Package

Adopt when:

  • You have already selected — or are running a time-boxed evaluation of — Ory Kratos. This is a thin generated SDK; it has no value standalone.
  • Your backend is PHP/Laravel and needs server-side calls to Kratos' public and admin APIs (self-service flow handling, session validation, user administration).
  • You want typed, OpenAPI-generated models and HTTP calls instead of hand-rolled Guzzle/cURL against raw endpoints.
  • You accept version lockstep: the client must track your Kratos API version, and someone owns upgrades and regenerating or re-vendoring the client when upstream changes.
  • Engineering is comfortable owning integration code — retry/backoff, error mapping, cookie/session bridging to Laravel guards — because the client is a transport layer, not an auth framework.

Look elsewhere when:

  • You are not committed to Kratos — use Laravel Fortify/Breeze/Jetstream/Sanctum for native auth, or a hosted provider (Auth0, Clerk, WorkOS, Firebase Auth) if speed matters more than control.
  • You need a batteries-included Laravel auth package. This is not that; expect to write the middleware, guards, and flow orchestration yourself.
  • You require vendor-supported SDKs with SLAs. PHP support around Kratos is community/generated; the official, best-supported SDKs are elsewhere (Go, JS). Hosted Ory Network reduces operational burden but does not upgrade the PHP client's support posture.
  • Low adoption is a material risk. 15 stars signals a small PHP user base — few eyes on bugs, thin community answers, uncertain long-term maintenance. If you cannot absorb a fork or generate an equivalent client internally, treat this as a dependency you must budget to own.
  • Your requirements are simple (one app, email/password, no SSO/MFA roadmap). Kratos plus this client is operational overhead you don't need.

How to Pitch It (Stakeholders)

For executives:

  • What it is: a PHP client library that lets our Laravel backend talk to Ory Kratos, an open-source identity server. It is glue, not a product.
  • Why it matters: authentication is expensive to build and expensive to get wrong. Pairing Kratos with this client lets us inherit mature SSO, MFA, passwordless, and account-recovery capabilities instead of funding them internally.
  • Commercial shape: Apache-2.0, no license fees. Self-hosting means infrastructure and on-call cost; hosted Ory Network is an optional buy that trades cost for reduced operational load. Either way, per-MAU pricing is not forced on us.
  • Honest risk statement: the PHP client has a very small community (15 stars) and generated code, which means we — not a vendor — own upgrades and edge cases. Recommend a short proof-of-concept (one flow end-to-end, e.g., login + session validation) before committing, and a named owner for the dependency.

For engineering:

  • OpenAPI-generated, typed, Apache-2.0. Treat it as a transport layer: we own retries, timeouts, error normalization, and the bridge between Kratos sessions and Laravel guards/middleware.
  • Pin the client to our Kratos version and track upstream API changes; be prepared to vendor or regenerate our own client if maintenance stalls. This is a one-to-two-week integration spike, not a drop-in.
  • Evaluate the direct-HTTP alternative early: a ~200-line internal client over Kratos' REST API may be lower long-term risk than an externally maintained SDK with limited adoption. Decide deliberately, not by default.
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