Symfony integration for Neo4j

Installs: 68 408

Dependents: 0

Suggesters: 0

Security: 0

Stars: 77

Watchers: 16

Forks: 40

Open Issues: 10


1.0.0-rc1 2023-06-06 10:11 UTC

This package is auto-updated.

Last update: 2024-05-08 12:12:02 UTC


Latest Version Build Status Code Coverage Quality Score Total Downloads


Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require neo4j/neo4j-bundle

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    \Neo4j\Neo4jBundle\Neo4jBundle::class => ['all' => true],


The bundle is a convenient way of registering services. We register Drivers and one Clients. You will always have alias for the default services:

  • neo4j.driver
  • neo4j.client

Minimal configuration

    default: ~

With the minimal configuration we have services named:

  • neo4j.driver.default
  • neo4j.client

Full configuration example

This example configures the client to contain two instances.

  profiling: true
  default_driver: high-availability
    - alias: high-availability
      dsn: 'neo4j://'
        type: 'oidc'
        token: '%neo4j.openconnect-id-token%'
      priority: 1
    # Overriding the alias makes it so that there is a backup server to use in case
    # the routing table cannot be fetched through the driver with a higher priority
    # but the same alias.
    # Once the table is fetched it will use that information to auto-route as usual.
    - alias: high-availability
      dsn: 'neo4j://'
      priority: 0
        type: 'oidc'
        token: '%neo4j.openconnect-id-token%'
    - alias: backup-instance
      dsn: 'bolt://localhost:7687'
        type: basic
        username: '%neo4j.backup-user%'
        password: '%neo4j.backup-pass%'


$ composer test

Example application

See an example application at (legacy project)


The MIT License (MIT). Please see License File for more information.