Download the PHP package thinwrap/notifications without Composer

On this page you can find all versions of the php package thinwrap/notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package notifications

thinwrap/notifications

Unified PHP facade over 35 notification providers across Email (10), SMS (10), Push (6), and Chat (9). Stateless. Zero vendor SDKs. Bring your own PSR-18 HTTP client.

Install

Requires PHP ≥8.2. PSR-18 HTTP client + PSR-17 factories are auto-discovered via php-http/discovery — if you don't already have one installed:

End-to-end example — 2-minute send

Switching providers

Change the NotificationProviderId case and config class; the EmailSendInput / SmsSendInput / PushSendInput / ChatSendInput shape stays identical.

Bring your own PSR-18 client

Inject any PSR-18 client through the client parameter on the *Config DTO — useful for tracing, mocking, or proxying through symfony/http-client.

php-http/discovery auto-detects an installed PSR-18 client (Guzzle, Symfony HttpClient, Buzz, etc.) when no $client is passed to the facade constructor.

The wrapper holds no state — no token cache, no connection pool, no retry buffer. The optional tokenCache hook on FcmConfig and ApnsConfig (the only two connectors with short-lived signed tokens) lets the consumer amortize signing cost; the hook owns the state, not the wrapper. See src/Providers/Fcm/README.md and src/Providers/Apns/README.md for hook shape.

Error handling

Every failure surfaces as ConnectorError with a typed ProviderCode. Compose your own retry strategy from $e->providerCode and $e->cause (which carries the raw Retry-After header where the vendor sets one). The wrapper performs no automatic retry.

The 6 ProviderCode cases are byte-exact across the TypeScript and PHP packages. ConnectorError extends \RuntimeExceptioncatch (\Throwable $e) works too.

cause shape

$e->cause is a uniform array across every connector:

There is no top-level structured retryAfterSeconds field on ConnectorError — the wrapper performs no retry. The parsed seconds live inside $e->cause['retryAfterSeconds'] and are also echoed in $e->providerMessage (… (Retry-After: N seconds)). retryAfter carries the raw value verbatim (string|int|null) and is intentionally not normalized. Discord additionally exposes its body-sourced retryAfterBody (float) in cause.

Transport-layer failures (the PSR-18 client throwing before any HTTP response) are surfaced with a generic providerMessage (Upstream transport error) and only the exception class name in cause — never the raw client-exception message. That message can embed the full request URL, which for some providers (Telegram bot token in the path; Slack/Discord/Google Chat/Mattermost/MS Teams webhook URLs) is the credential. Do not log the raw HTTP-client exception directly for the same reason.

_passthrough escape valve

When the normalized input doesn't expose a vendor-specific field, forward arbitrary keys via the _passthrough parameter on the send input. Body merges deep, headers and query merge shallow, consumer values win on conflict. Keys are forwarded verbatim.

Each per-connector README documents vendor-specific _passthrough examples.

Bring your own connector

When _passthrough isn't enough — the provider isn't shipped at all — implement the channel's Contract\*ConnectorInterface (a single send() method over the normalized DTOs) and build the facade with fromConnector(). You keep the normalized input/result shapes and the uniform ConnectorError path; only the wire call is yours.

Throw ConnectorError from send() for hard failures so consumers keep a single error-handling path; return success: false for HTTP-2xx-but-rejected soft-rejects, matching the built-in connectors.

Language constraints (PHP)

Per-connector documentation

Each per-connector README documents auth, endpoints (regional / sandbox), narrowed input augmentations, error-code mappings, and _passthrough examples.

Email (10)

Provider README
ses src/Providers/Ses/README.md
resend src/Providers/Resend/README.md
mailgun src/Providers/Mailgun/README.md
sendgrid src/Providers/Sendgrid/README.md
postmark src/Providers/Postmark/README.md
mailersend src/Providers/Mailersend/README.md
mailtrap src/Providers/Mailtrap/README.md
brevo src/Providers/Brevo/README.md
sparkpost src/Providers/Sparkpost/README.md
scaleway src/Providers/Scaleway/README.md

SMS (10)

Provider README
vonage src/Providers/Vonage/README.md
twilio src/Providers/Twilio/README.md
plivo src/Providers/Plivo/README.md
sns src/Providers/Sns/README.md
sinch src/Providers/Sinch/README.md
telnyx src/Providers/Telnyx/README.md
infobip src/Providers/Infobip/README.md
messagebird src/Providers/Messagebird/README.md
textmagic src/Providers/Textmagic/README.md
d7networks src/Providers/D7networks/README.md

Push (6)

Provider README
fcm src/Providers/Fcm/README.md
expo src/Providers/Expo/README.md
apns src/Providers/Apns/README.md
one-signal src/Providers/OneSignal/README.md
pusher-beams src/Providers/PusherBeams/README.md
wonderpush src/Providers/Wonderpush/README.md

Chat (9)

Provider README
telegram src/Providers/Telegram/README.md
slack src/Providers/Slack/README.md
whatsapp-business src/Providers/WhatsappBusiness/README.md
discord src/Providers/Discord/README.md
msteams src/Providers/Msteams/README.md
google-chat src/Providers/GoogleChat/README.md
mattermost src/Providers/Mattermost/README.md
rocket-chat src/Providers/RocketChat/README.md
line src/Providers/Line/README.md

Baseline-coverage discipline

The unified facade surface includes only features ≥90% of providers in each channel support natively. Sub-baseline fields are accessible via per-provider narrowed input DTOs (<Provider>NarrowedInput) and the _passthrough escape hatch.

Migrating

From a vendor PHP SDK

Vendor-SDK conveniences (auto-retry, telemetry, idempotency-key generation) are intentionally absent — compose your own.

From hand-rolled HTTP / Guzzle

If you've been hand-rolling vendor HTTP calls with Guzzle, the facade collapses the boilerplate to one line per call. Error handling and retry composition stay yours; the PSR-18 client passes through unchanged via the facade constructor's $client argument.

From a previous Thinwrap PHP version

Not applicable at v1.0; thinwrap/notifications has not previously published. Forward looking: when v2.0 ships with breaking changes, this section will carry the v1→v2 recipe.

For AI agents and contributors

AI agents working with this package should consult .ai/guidelines.md first.

Security

See SECURITY.md for private vulnerability disclosure. Releases are cosign-signed via GitHub Actions OIDC (no static signing keys); maintainer accounts require two-factor authentication (TOTP via an authenticator app) on GitHub. Packagist consumes the package via webhook auto-sync — no long-lived Packagist API token is stored anywhere.

License

MIT — see LICENSE.

Contributing

See CONTRIBUTING.md.


All versions of notifications with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0 || ^2.0
php-http/discovery Version ^1.20
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thinwrap/notifications contains the following files

Loading the files please wait ...