PHPackages                             blackford/twilio-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. blackford/twilio-bundle

ActiveSymfony-bundle[API Development](/categories/api)

blackford/twilio-bundle
=======================

Symfony 5+ / PHP 8+ wrapper for the official Twilio SDK v6+

v5.0.1(9y ago)445.2k↑63.3%3[1 PRs](https://github.com/mblackford/BlackfordTwilioBundle/pulls)MITPHPPHP &gt;=5.3.2CI failing

Since Oct 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mblackford/BlackfordTwilioBundle)[ Packagist](https://packagist.org/packages/blackford/twilio-bundle)[ Docs](https://github.com/mblackford/BlackfordTwilioBundle)[ RSS](/packages/blackford-twilio-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (13)Used By (0)

Symfony Twilio Bundle (for Twilio SDK v6)
=========================================

[](#symfony-twilio-bundle-for-twilio-sdk-v6)

About
=====

[](#about)

A quick and easy way to use the Twilio SDK (version 6) in a Symfony based application. Support for PHP 8+, Symfony &gt;= 5.4. For full documentation about how to use the Twilio Client, see the [official SDK](https://github.com/twilio/twilio-php) provided by [Twilio](https://www.twilio.com/).

This bundle is a small wrapper around the official sdk. It just adds the basic auth and configs and avoid that you have to configure your service.yaml manual.

If you are already using the [symfony/notifier](https://symfony.com/doc/current/notifier.html) component, habe a look at [twilio-notifier](https://symfony.com/components/Twilio%20Notifier).

Thank you for the awesome work of [Fridolin Koch](http://fkse.io) who created the first version of this bundle, with support for version 4 of the SDK.

Installation
============

[](#installation)

```
composer req blackford/twilio-bundle

```

Configuration
=============

[](#configuration)

Add these 2 parameters in `.env.local` and set it to your twilio credentials. Please see [Env-Variables](https://symfony.com/doc/current/configuration/env_var_processors.html) for more details.

```
TWILIO_USER='!changeMe!'
TWILIO_PASSWORD='!changeMe!'
```

Add a new file `config/packages/twilio.yml` and copy and adjust the following content:

```
blackford_twilio:

  # (Required) Username to authenticate with, typically your Account SID from www.twilio.com/user/account
  username: '%env(TWILIO_USER)%'

  # (Required) Password to authenticate with, typically your Auth Token from www.twilio.com/user/account
  password: '%env(TWILIO_PASSWORD)%'

  # (Optional) Account Sid to authenticate with, defaults to  (typically not required)
  # accountSid:

  # (Optional) Region to send requests to, defaults to no region selection (typically not required)
  # region:
```

Usage
=====

[](#usage)

[Configure your Twilio-Account](https://www.twilio.com/blog/verifying-twilio-api-requests-php-symfony-5)

Provided services:

ServiceClass`twilio.client``\Twilio\Rest\Client`Inside a controller:
--------------------

[](#inside-a-controller)

```
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Twilio\Rest\Client as TwilioClient;

class TestController extends Controller
{
    public function __construct(private TwilioClient $twilioClient)
    {}

    public function smsAction()
    {
        $date = date('r');

        $message = $this->twilioClient->messages->create(
            '+12125551234', // Text any number
            array(
                'from' => '+14085551234', // From a Twilio number in your account
                'body' => "Hi there, it's $date and Twilio is working properly."
            )
        );

        return new Response("Sent message [$message->sid] via Twilio.");
    }
}
```

Inside a console command:
-------------------------

[](#inside-a-console-command)

```
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Twilio\Rest\Client as TwilioClient;

#[AsCommand(name: 'twilio:test:sms', description: 'Test the Twilio integration by sending a text message.')]
class TwilioTestCommand extends ContainerAwareCommand
{
    public function __construct(private TwilioClient $twilioClient)
    {}

    protected function execute(InputInterface $input, OutputInterface $output)
    {
         $date = date('r');

         $message = $this->twilioClient->messages->create(
             '+12125551234', // Text any number
             array(
                 'from' => '+14085551234', // From a Twilio number in your account
                 'body' => "Hi there, it's $date and Twilio is working properly."
             )
         );

        $output->writeln("Sent message [$message->sid] via Twilio.");
    }
}
```

Copyright / License
===================

[](#copyright--license)

See [LICENSE](LICENSE)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 56.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~136 days

Recently: every ~74 days

Total

12

Last Release

3504d ago

Major Versions

0.5.0 → v1.0.02016-02-06

1.0.2 → v5.0.02016-11-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2366796?v=4)[Matthew Blackford](/maintainers/mblackford)[@mblackford](https://github.com/mblackford)

---

Top Contributors

[![fridolin-koch](https://avatars.githubusercontent.com/u/1880828?v=4)](https://github.com/fridolin-koch "fridolin-koch (51 commits)")[![mblackford](https://avatars.githubusercontent.com/u/2366796?v=4)](https://github.com/mblackford "mblackford (14 commits)")[![Chris8934](https://avatars.githubusercontent.com/u/44963939?v=4)](https://github.com/Chris8934 "Chris8934 (9 commits)")[![StudioMaX](https://avatars.githubusercontent.com/u/9878458?v=4)](https://github.com/StudioMaX "StudioMaX (6 commits)")[![josephnle](https://avatars.githubusercontent.com/u/2822954?v=4)](https://github.com/josephnle "josephnle (4 commits)")[![jasonroman](https://avatars.githubusercontent.com/u/2953795?v=4)](https://github.com/jasonroman "jasonroman (2 commits)")[![jeremib](https://avatars.githubusercontent.com/u/565742?v=4)](https://github.com/jeremib "jeremib (1 commits)")[![Bukashk0zzz](https://avatars.githubusercontent.com/u/1908342?v=4)](https://github.com/Bukashk0zzz "Bukashk0zzz (1 commits)")[![bonswouar](https://avatars.githubusercontent.com/u/615053?v=4)](https://github.com/bonswouar "bonswouar (1 commits)")[![pmartelletti](https://avatars.githubusercontent.com/u/557390?v=4)](https://github.com/pmartelletti "pmartelletti (1 commits)")

---

Tags

twilio

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/blackford-twilio-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/blackford-twilio-bundle/health.svg)](https://phpackages.com/packages/blackford-twilio-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[sulu/headless-bundle

Bundle that provides controllers and services for using Sulu as headless content management system

56146.1k2](/packages/sulu-headless-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
