PHPackages                             davidecesarano/embryo-ssr - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. davidecesarano/embryo-ssr

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

davidecesarano/embryo-ssr
=========================

Server Side Rendering Javascript in PHP application with V8Js.

03PHP

Since Jul 24Pushed 6y agoCompare

[ Source](https://github.com/davidecesarano/Embryo-SSR)[ Packagist](https://packagist.org/packages/davidecesarano/embryo-ssr)[ RSS](/packages/davidecesarano-embryo-ssr/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Embryo SSR (Server Side Rendering)
==================================

[](#embryo-ssr-server-side-rendering)

Server Side Rendering Javascript in PHP application with V8Js.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1
- V8Js PHP extension (See [V8 Javascript compiled files for PHP](https://github.com/davidecesarano/phpv8js-compiled))

Installation
------------

[](#installation)

Using Composer:

```
$ composer require davidecesarano/embryo-ssr

```

Usage
-----

[](#usage)

You can use SSR if you want rendering a "snapshot" of our app. The JavaScript frameworks (like Vuejs or React) build client-side applications that manipulate DOM in the browser as output.

With Embryo SSR is possible to render the components into HTML strings on the server, send them directly to the browser, and finally "hydrate" the static markup into a fully interactive app on the client.

```
use Embryo\ServerSideRendering\SSR;

$v8js = new \V8Js;
$ssr = new SSR($v8js);

echo $ssr
    ->env([
        'NODE_ENV' => 'production',
        'VUE_ENV' => 'server'
    ])
    ->context([
        'user' => [
            'name' => 'Davide'
        ]
    ])
    ->entry('path/to/js/entry-server.js')
    ->render();
```

Example
-------

[](#example)

You may quickly test using the built-in PHP server going to .

```
$ cd example
$ php -S localhost:8000

```

Options
-------

[](#options)

### `enabled(bool $enabled = true): self`

[](#enabledbool-enabled--true-self)

Enables or disables server side rendering. When disabled, the client script and the fallback html will be rendered instead.

### `env(array $env): self`

[](#envarray-env-self)

ENV variables are placed in `process.env` when the server script is executed.

### `entry($entry): self`

[](#entryentry-self)

The path to your server script. Must be an arrary for multiple files.

### `context(array $context): self`

[](#contextarray-context-self)

Context is passed to the server script in the `context` variable.

### `script(string $script): self`

[](#scriptstring-script-self)

Writes a javascript script. For example: `var a = "My Var"`.

### `fallback(string $fallback): self`

[](#fallbackstring-fallback-self)

Sets the fallback html for when server side rendering is disabled. For example: ``.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16277144?v=4)[Davide Cesarano](/maintainers/davidecesarano)[@davidecesarano](https://github.com/davidecesarano)

---

Top Contributors

[![davidecesarano](https://avatars.githubusercontent.com/u/16277144?v=4)](https://github.com/davidecesarano "davidecesarano (1 commits)")

---

Tags

php-v8jsserver-side-renderingssr

### Embed Badge

![Health badge](/badges/davidecesarano-embryo-ssr/health.svg)

```
[![Health](https://phpackages.com/badges/davidecesarano-embryo-ssr/health.svg)](https://phpackages.com/packages/davidecesarano-embryo-ssr)
```

PHPackages © 2026

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