- How do I install owenvoke/ecologi in a Laravel app?
- Install it with Composer using composer require owenvoke/ecologi. Laravel package auto-discovery registers the service provider and facade, so you usually do not need to add them manually. Then publish the package config and add your Ecologi API credentials. For standalone PHP projects you can instantiate the client directly instead of using the facade.
- Which Laravel and PHP versions does this package support?
- The package declares PHP and Illuminate version constraints in its composer.json, so check those against your runtime before adopting it. Because it is a small wrapper, those constraints are the main compatibility risk rather than the API surface. If a constraint blocks a planned Laravel upgrade, forking the package and widening the range is a realistic option. Always run your application test suite against the new runtime before release.
- How do I configure my Ecologi API key?
- Publish the package configuration file, then supply the API key through the published config or the environment variable it references. Treat that key as a financial credential, because the write endpoints can spend real money from your Ecologi balance. Store it in your secret manager, scope it with a spend limit where Ecologi supports that, and assign a named owner for rotation. Use separate keys per environment.
- How do I plant trees with the Ecologi API using this package?
- Resolve the client or facade and call the tree-planting method with the number of trees and any supported metadata, such as a project or tag. The wrapper handles request construction and response hydration, so you get structured objects back. Remember that a successful call is a real purchase against your Ecologi balance, so wrap it in your own authorization, audit logging, and reconciliation. Start with read-only calls while you validate the integration.
- Does owenvoke/ecologi handle retries, idempotency, or spend limits?
- No. It is a thin adapter that covers authentication, request building, and response hydration. Retry policy, idempotency keys, per-environment spend caps, and reconciliation are your responsibility. This matters most for purchase endpoints, where a retried request can double-spend. Implement an attempt ledger and reconcile against Ecologi's own reported totals before enabling writes in production.
- Can I use this package without Laravel, in plain PHP?
- Yes. It is an object-oriented PHP wrapper with a Laravel integration layered on top. You can install it with Composer and use the underlying client directly in any modern PHP application. The facade and config publishing are conveniences, not requirements.
- How do I test my Ecologi integration without spending money?
- Begin with the read endpoints, such as impact totals and community statistics, which do not spend funds. Mock the HTTP layer in unit tests so no real requests leave your suite. For write paths, test against a sandbox if Ecologi offers one and confirm the details in their API documentation. Never point automated tests at a production key with a live balance.
- What happens if an Ecologi API call fails during a customer checkout?
- The package surfaces API and transport failures as exceptions; it does not provide a fail-soft contract. If climate action is a side effect of a purchase, catch those exceptions and let the purchase succeed, then queue the offset for a later attempt. An offset failure must never fail the customer's transaction. Log the failure and reconcile the queued attempt afterwards.
- Is owenvoke/ecologi actively maintained, and what are the alternatives?
- It is a single-maintainer package with no dependents and a modest star count, so assume you may be the first serious adopter. Fork it into your organisation on day one, assign an owner, add CI, and pin versions. The main alternative is a small in-house client built on Guzzle or any PSR-18 HTTP client, which is a few days of work because the Ecologi API surface is narrow. That fallback is cheap enough that maintenance risk should not block a read-path pilot.
- How do I retrieve carbon offset and impact data with this package?
- Use the read methods for impact totals and community statistics, which return hydrated response objects. These calls do not spend money and are the right starting point for a pilot. Persist the figures you need for reporting in your own database so your history survives a change of vendor. Schedule the reads rather than calling them inline in user requests.