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

Origami Api Sdk Laravel Package

origami-mp/origami-api-sdk

origami-mp/origami-api-sdk is a PHP SDK for the Origami API, providing a convenient client to streamline authentication and endpoint requests. It helps Laravel and PHP developers integrate with Origami services faster with less boilerplate and more consistent API handling.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

The SDK imposes a well-defined layering: API repository (public seam) → client repository (HTTP transport) → DTO (response parsing/validation), with param bags for requests, enums for constrained values, and traits + contracts for cross-cutting behavior. For a Laravel application this is a genuinely clean integration seam — business code talks to repositories and receives typed DTOs, not arrays or raw Response objects.

Three properties matter most for fit:

  • Boundary validation. DTOs validate the API response before it reaches application code. Contract drift fails loudly at the edge instead of silently propagating nulls and missing keys — this is the SDK's strongest architectural asset and the main reason to prefer it over hand-rolled Guzzle calls.
  • Auth segmentation. Data (authenticated), Guest (public) and Oauth repositories model three distinct credential flows as separate namespaces rather than a boolean flag. Good separation; it also means the app owns three credential lifecycles, not one.
  • Thin, not opinionated. The SDK is a transport-and-typing layer, not a domain model. There is no caching, no persistence, no queueing. Everything operational stays in the consuming app.

Fit is high if the Origami API is a first-class dependency of the product (as it appears to be for origami_admin_v2). Fit is low if you only need one or two endpoints: you would inherit the full DTO/param-bag/enum surface and a strict set of contribution conventions for a fraction of the value.

Integration feasibility

Mechanically straightforward — a Composer package under MIT. Feasibility is gated on facts not in evidence, which is where the TPM effort should go:

Unknown Why it blocks How to resolve
Distribution channel 0 dependents alongside a real consumer (origami_admin_v2) implies install via VCS/path repository or a private registry, not Packagist. CI and lockfile reproducibility depend on this. Inspect the consumer's composer.json
PHP / Laravel support matrix Pint with the Laravel preset implies Laravel 9+ idioms, but no composer.json constraints are documented. Read require / CI matrix
Package bootstrap The conventions reference "classes adapting Laravel" in helpers, implying Laravel coupling without necessarily shipping a service provider or publishable config. Manual container bindings may be required. Spike: install into a scratch app, resolve one Data repository end-to-end
HTTP client, timeouts, retries Not visible in the conventions. Whether the SDK exposes Guzzle handler config determines if retry/backoff is yours or theirs. Read a client repository base class

Realistically a 2–5 day spike answers all four. That is cheap relative to the cost of discovering a missing retry hook after go-live.

Technical risk

Risk Severity Notes
API contract drift High Response shapes are defined by the sibling repo origami_api. The SDK validates them, so drift becomes a production exception rather than data corruption — better, but still a runtime outage on unversioned deploys. Mitigation: pin SDK version, deploy SDK bumps with API changes, alert on OrigamiApiSdkException rate.
Enum drift Medium–High PHP enums are closed sets. A new API enum value reaching a deployed app produces an unhandled case. Rule::enum() protects outbound validation but not inbound decoding. Confirm the DTO fallback behavior for unknown enum values — this is the single most likely 3 a.m. failure.
Credential handling Medium Three auth flows, Oauth included. Confirm token storage, refresh, and whether refresh is SDK-owned or app-owned; ambiguity here usually ends up duplicated in every consumer.
Bus factor Medium–High Zero stars, zero dependents, opaque ownership. One team, likely one or two authors.
Unproven at scale Medium No external consumers means edge cases (pagination boundaries, partial list failures, large payloads) are validated only by whatever origami_admin_v2 happens to exercise.
Release metadata anomaly Low "Last release 2026-08-07" is future-dated. Likely a monorepo tag or CI artefact, but verify provenance before pinning — it undermines confidence in the version history you are about to depend on.
Ceremony tax Low–Medium The conventions are strict (Pint, element ordering, spread-over-array_merge, one-rule-one-place docs). Excellent consistency; any local fork or extension carries real cost.

Key questions

  1. Who owns origami_api and the SDK — one team or two? Is there a stated versioning/semver policy for breaking response changes?
  2. What is the API's availability target, and is it covered by a written SLA the SDK's retry behavior is tuned against?
  3. Does the SDK own Oauth token refresh, or does each consumer reimplement it?
  4. How are unknown enum values handled inbound — exception, null, or passthrough?
  5. Are timeouts, retries, and backoff configurable, and what are the defaults? Are they appropriate for a user-facing request path?
  6. Is origami_admin_v2 the only consumer, and is it pinned to a tag or tracking a branch?
  7. Is the package installable from Packagist, or does it require private registry / VCS credentials in CI?
  8. What is the SDK's release cadence relative to the API's — same-day, or is there a lag that turns API changes into consumer outages?

Integration Approach

Stack fit

Laravel-first by construction: Laravel Pint preset, Laravel validation rules (Rule::enum()) in DTOs, and helper classes that explicitly adapt Laravel. That is a good sign for idiom alignment and a bad sign for portability — do not expect this to drop into Symfony or a framework-agnostic service without friction.

Recommended placement: one adapter module at the application boundary, not SDK types scattered through controllers, jobs, and Blade views. Concretely:

  • Bind client repositories (or a factory for them) as singletons in a service provider, configured from config/services.php / env — never construct them inline.
  • Wrap each API repository in a thin application-level interface (e.g. CustomerLookup) and return your own models or plain value objects. Keep DTOs inside the module.
  • This costs ~1 small class per use case and buys you the ability to swap SDK versions, mock in tests, and survive a breaking DTO change without a codebase-wide diff.

Migration path

Assume the likely starting state is raw Http:: / Guzzle calls to the Origami API scattered across the app.

  1. Strangler, per endpoint. Introduce the adapter interface first with the existing Guzzle implementation behind it. No SDK yet — this step is pure decoupling and is valuable on its own.
  2. Swap implementations one endpoint at a time behind the unchanged interface. Diff behavior in staging against the legacy path (log both responses for a short window).
  3. Retire raw calls only after the endpoint has run clean through a full business cycle — including the failure paths (401 → refresh, 429, 5xx).
  4. Never migrate in a big-bang PR. The value of the SDK is typing, not coverage; a partially migrated app is a perfectly good steady state.

Compatibility

Pin exactly ("x.y.z", not ^x.y) for the first two quarters. Pin for two reasons: the consumer base is too small to trust semver discipline, and DTO changes are precisely the kind of breaking change that semver minor bumps are supposed to preclude and frequently do not. Add a CI job that resolves the lockfile against the pinned tag so a yanked or re-tagged release is caught before deploy.

Confirm the PHP and Laravel constraints against the app's matrix before sequencing work — a PHP minor mismatch invalidates the whole plan.

Sequencing

Phase Work Gate
1. Diligence (2–5 days) Spike install; read composer.json, a client repository base class, one DTO and one exception family; answer questions 1–8 Go/no-go
2. Decoupling (1–2 sprints) Introduce adapter interfaces over existing HTTP calls; no SDK Interfaces stable, tests green
3. Pilot (1 sprint) Migrate one read-only Guest endpoint and one Data endpoint; wire exception handling + alerting Error rate flat vs legacy for 2 weeks
4. Auth hardening Confirm Oauth token refresh ownership; implement in one place Token expiry handled without user-visible failure
5. Broad migration Remaining endpoints, ordered by traffic × risk (low-traffic first) —

Recommendation: conditional go. The SDK is a well-designed thin layer whose main cost is coupling to an API you are already coupled to — that is a favorable trade. Proceed on the strength of phases 1–3, and treat the diligence gate as real: if ownership, versioning policy, or enum-drift behavior are unanswerable, the correct outcome is to keep the adapter layer from phase 2 and skip the SDK entirely. That leaves you no worse off and materially more flexible.

Operational Impact

Maintenance

Low ongoing code maintenance — the SDK is thin and does no scheduling, caching, or state management. The maintenance cost sits elsewhere:

  • Version churn. Expect SDK bumps to be driven directly by API changes. Budget a recurring line item (roughly one to two engineer-days per month) for bumping, reading diffs, and re-running integration tests, separate from feature work.
  • Conventions tax on local extension. If you ever need behavior the SDK lacks (a custom retry policy, a bespoke endpoint), the documented path is a PR upstream — the conventions are strict and any new coding pattern requires a same-PR documentation update. Forking is possible but forfeits the main benefit of the upstream. Prefer wrapping over forking, always.
  • Documentation quality is the standout. The sdk-conventions skill is unusually well-structured — indexed rule files, references to real test classes, an explicit "don't invent a convention, follow the closest existing pattern" rule. That is a genuine maintenance asset and will materially cut onboarding time.

Support

This is the weakest dimension and the one to escalate. Zero stars and zero dependents means no external support surface: no issue history to search, no Stack Overflow corpus, no third-party blog posts. Every question routes to the owning team. Two operational requirements follow:

  1. Establish a named channel (Slack channel or shared board) with the SDK owners and a stated response expectation, before the first production deploy — not after the first incident.
  2. Instrument locally. Because you cannot rely on community diagnoses, your own telemetry is the primary diagnostic tool. Log every OrigamiApiSdkException with the exception family, the repository class, and the endpoint — the exception hierarchy is designed for exactly this discrimination and is wasted if you log a generic string.

Scaling

The SDK does not scale the thing that will actually limit you: the Origami API. Treat the SDK as a pass-through and locate all capacity concerns server-side.

Client-side considerations that do matter at volume:

  • Connection reuse. Confirm the underlying HTTP client is reused across requests rather than instantiated per call; a fresh Guzzle client per repository call will quietly cost TLS handshakes under load.
  • Retry amplification. If the SDK retries and your jobs/queue retry and your HTTP middleware retries, a degraded API sees multiplicatively more traffic. Pick exactly one retry owner — recommend the SDK — and disable the others for these calls.
  • Rate limits. Confirm the API's rate-limit headers and whether the SDK surfaces them. At volume you want a 429 to back off, not to burn through a queue's retry budget.
  • Payload size. DTO-per-response parsing means large list responses are fully materialized. If any endpoint returns unbounded lists, paginate aggressively at the adapter layer.
  • Queue placement. Long-running or bulk Origami calls belong on queued jobs with explicit timeouts, not in the request path. The SDK gives you typed results, which makes this refactor cheap if done during the pilot rather than later.

Failure modes

Ranked by likelihood × blast radius:

  1. Enum decode failure on new API values — most likely incident. A deployed app receives an enum case it does not know. Mitigation: alert on exception family, and confirm whether the failure is isolated to one DTO or fails the whole response.
  2. Contract drift on a response field — DTO validation throws. Correct behavior, still a user-visible error. Mitigation: deploy SDK bumps ahead of or atomically with API changes; canary the first requests.
  3. Auth failure / token expiry — surfaces as a burst of Data/Oauth exceptions. Blast radius is the whole authenticated surface, so this needs a distinct alert rather than a generic error counter.
  4. Timeout under API degradation — cascades into queue backlogs and, if calls are in the request path, user-facing latency. Mitigation: aggressive timeouts, circuit breaking at the adapter layer.
  5. Silent partial data — the dangerous one. If any DTO path tolerates missing fields (nulls rather than exceptions), downstream logic may compute on incomplete data without any error. Verify the DTO validation rules actually cover the fields your business logic branches on.
  6. Distribution failure — pinned tag disappears or private registry auth breaks in CI. Boring, disruptive, and cheap to prevent: vendor the pinned version or mirror it internally.

Ramp-up

Favorable, and this is the package's most underrated quality.

  • For engineers: the layered model (repository → DTO → param bag) is learnable in under a day. The conventions doc is indexed by "read this when…", which is exactly the right shape for a mid-level engineer adding a new endpoint.
  • Estimate: one engineer fully productive on SDK work within 2–3 days; code-review-competent within 1–2 weeks, since review requires knowing the ordering and naming rules well enough to catch violations.
  • For AI-assisted contribution: the conventions are packaged as an agent skill, so an assistant working in this repo produces conforming code rather than plausible-looking drift. In practice this is a meaningful throughput multiplier for the mechanical work (new endpoint = param bag + repository method + DTO + test) and should be planned for explicitly rather than discovered.
  • Ramp-up risk is concentrated, not distributed. Because the doc is good, onboarding is fast — but it teaches conventions well and judgment not at all. Pair the doc with a designated reviewer who has seen the API's failure modes; do not let the quality of the written conventions substitute for that.

Bottom line for operations: low code-maintenance burden, favorable ramp-up, and one materially unhedged exposure — you are adopting an unproven internal SDK with a single owning team and no external support corpus. That is acceptable for an internal product where the API is already a hard dependency, provided the diligence gate confirms ownership, versioning policy, and enum-drift behavior, and provided you invest early in the adapter boundary and the telemetry that replaces the community support you will not have.

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.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo