- Does sendpulse/rest-api work with Laravel?
- It is a plain PHP REST client with no Laravel service provider, facade, config file, or auto-discovery. You can bind Sendpulse\RestApi\Client in a service provider and inject it, but the Laravel glue is yours to own. It has no framework coupling, so Laravel compatibility mainly depends on meeting PHP 8.3+ and ext-curl/ext-json rather than a Laravel version constraint.
- How do I install sendpulse/rest-api?
- Install it with Composer using composer require sendpulse/rest-api. The README lists PHP 8.3 or newer plus ext-curl and ext-json, with optional PSR-18 HTTP client and PSR-16 cache adapters. There are no Laravel publish steps because the package ships no Laravel assets.
- How do I configure SendPulse API credentials in Laravel?
- Create the client with either apiKey or clientId and clientSecret from your own config/services.php entry or environment variables. Then bind it as a singleton in a service provider if you want constructor injection. Do not expect a package config file or facade.
- What authentication methods does sendpulse/rest-api support?
- It supports SendPulse API key auth and OAuth client-credentials auth. The README shows new Client(apiKey: ...) and new Client(clientId: ..., clientSecret: ...). For OAuth, tokens are fetched automatically and stored between requests by the configured storage.
- Where does sendpulse/rest-api store OAuth tokens?
- The documented default stores OAuth tokens on disk between requests. That default is not suitable for containerised or multi-node Laravel deployments because local disk is not shared or coordinated. Plan a cache- or database-backed token storage adapter and test the refresh path explicitly.
- Can sendpulse/rest-api be used in Laravel queued jobs?
- Yes, but every call is a blocking cURL request, so use queued jobs rather than synchronous calls in request cycles. Wrap the client behind an internal gateway and add rate limiting, retries, and observability around the job. This keeps SendPulse latency and failures out of user-facing requests.
- Does sendpulse/rest-api support bulk email, SMTP, SMS, CRM, and chatbots?
- The README exposes services for bulk email campaigns and address books, transactional SMTP email, SMS campaigns, CRM contacts and deals, and chatbot bots. Typed models are generated from OpenAPI specs, though some mailing-list methods still return arrays. Start with the service you need rather than assuming every endpoint is equally modelled.
- How should I test a SendPulse integration in Laravel?
- Use contract tests against a SendPulse sandbox account in CI because payloads can be associative arrays and typos may surface only at runtime. Mock your internal gateway in application tests so domain code does not depend on the SDK directly. Explicitly test authentication, token storage, refresh, and failed API responses.
- What are alternatives to sendpulse/rest-api?
- For email specifically, evaluate Laravel-native or transport abstractions such as SES, Mailgun, or Postmark, and Twilio for SMS, depending on deliverability, pricing, and regional needs. The package is thin enough to wrap behind an internal gateway so you can swap providers later. Its value is SendPulse API coverage, not a Laravel mail transport.
- Is sendpulse/rest-api actively maintained and safe for production?
- It is the official SendPulse SDK, but the assessment flags weak adoption, about 117 stars and zero dependents, plus thin documentation and a version jump from 1.0.x to 2.0.1 with early auth and request-handling fixes. Verify the actual Composer release history and commit activity before relying on the listed release date. For production, pin versions conservatively, wrap the client, and use a robust token storage adapter.