byhaskell/novaposhta-bundle

Nova Poshta integration bundle for Symfony

Installs: 33

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:symfony-bundle

v0.2.2 2025-09-16 05:39 UTC

This package is auto-updated.

Last update: 2025-09-16 05:39:40 UTC


README

License Latest Stable Version Total Downloads

About

Nova Poshta integration bundle for Symfony (6, 7)

Created by @byhaskell

#StandWithUkraine 🇺🇦

What's this?

This library can be used for easy interaction with Nova Poshta.

Installation Symfony Flex

composer require byhaskell/novaposhta-bundle

Installation without Symfony Flex

$bundles = array(
	// ... other bundles
    new byhaskell\NovaPoshtaBundle\ByhaskellNovaPoshtaBundle(),
);

Configuration

Create new file: config/packages/byhaskell_nova_poshta.yaml

byhaskell_nova_poshta:
    # You can create one on the Nova Poshta website at:
    # https://new.novaposhta.ua/dashboard/settings/developers
    api_key: '%env(NP_API_KEY)%'
    base_url: 'https://api.novaposhta.ua/v2.0/json/'

Add NP_API_KEY in .env

Usage

public function index(\byhaskell\NovaPoshtaBundle\NovaPoshta $novaPoshta): JsonResponse
{
    $response = $novaPoshta->address()->searchSettlements('Київ');
    if ($response->isSuccess()) {
        /** @var AddressResponse $result */
        $result = $response->getResult();
    } else {
        // Errors 
        // $response->getInfo();
        // $response->getErrors();
        // $response->getWarnings();
    }
}

Copyright / License

See LICENSE