Weave Code
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

Typeform Bundle Laravel Package

beloop/typeform-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle to your composer.json:

    composer require beloop/typeform-bundle
    

    Register it in config/bundles.php:

    return [
        // ...
        Beloop\TypeformBundle\BeloopTypeformBundle::class => ['all' => true],
    ];
    
  2. Configuration Publish the default config:

    php bin/console beloop:typeform:install
    

    Update config/packages/beloop_typeform.yaml with your Typeform API credentials:

    beloop_typeform:
        api_key: 'your_typeform_api_key'
        webhook_secret: 'your_webhook_secret'
    
  3. First Use Case Trigger a Typeform submission via a Symfony command:

    php bin/console beloop:typeform:submit --form-id=12345 --data='{"name":"John","email":"john@example.com"}'
    

Implementation Patterns

Core Workflows

  1. Submission Handling Use the TypeformClient service to submit forms programmatically:

    $client = $container->get('beloop.typeform.client');
    $response = $client->submitForm(12345, ['name' => 'Alice', 'email' => 'alice@example.com']);
    
  2. Webhook Integration Extend the TypeformWebhookController to handle incoming submissions:

    use Beloop\TypeformBundle\Controller\TypeformWebhookController;
    
    class CustomWebhookController extends TypeformWebhookController
    {
        public function onSubmitAction(Request $request)
        {
            $data = $this->getSubmissionData($request);
            // Process data (e.g., save to DB, trigger email)
        }
    }
    
  3. Form Management Fetch forms via the TypeformManager:

    $forms = $this->get('beloop.typeform.manager')->getForms();
    

Integration Tips

  • Symfony Forms: Bind Typeform submissions to Symfony forms for validation:
    $form = $this->createFormBuilder($data)
        ->add('name', TextType::class)
        ->getForm();
    $form->submit($submissionData);
    if ($form->isValid()) { /* ... */ }
    
  • Event Dispatching: Dispatch custom events for submissions:
    $dispatcher->dispatch(new TypeformSubmissionEvent($submissionData));
    

Gotchas and Tips

Pitfalls

  1. Deprecated API The bundle uses Typeform’s v1 API (deprecated in 2021). Migrate to the v2 API for long-term use. Workaround: Use a wrapper like typeform/php-sdk alongside this bundle.

  2. Webhook Validation Always validate webhook signatures:

    $this->validateWebhook($request, $this->getParameter('beloop_typeform.webhook_secret'));
    
  3. Rate Limits Typeform’s free tier has strict rate limits. Cache form responses aggressively:

    # config/packages/cache.yaml
    beloop_typeform:
        cache_enabled: true
        cache_lifetime: 3600
    

Debugging

  • Logs: Enable debug mode in config/packages/beloop_typeform.yaml:
    debug: true
    
  • API Errors: Check var/log/dev.log for raw Typeform API responses.

Extension Points

  1. Custom Responses Override Beloop\TypeformBundle\Service\TypeformClient to modify API calls:

    services:
        beloop.typeform.client:
            class: App\Service\CustomTypeformClient
            parent: beloop.typeform.client
    
  2. Data Transformers Use the TypeformDataTransformer interface to sanitize/transform submissions:

    $transformer = new CustomTransformer();
    $cleanData = $transformer->transform($rawSubmission);
    
  3. Event Listeners Subscribe to typeform.submission events in config/services.yaml:

    services:
        App\EventListener\TypeformListener:
            tags:
                - { name: kernel.event_listener, event: typeform.submission, method: onSubmission }
    
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.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours