PHPackages                             hammerstone/sidecar-inertia - 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. hammerstone/sidecar-inertia

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

hammerstone/sidecar-inertia
===========================

A Laravel package to render Inertia apps on AWS Lambda.

v0.0.5(3y ago)6210.9k↓50%16[3 issues](https://github.com/aarondfrancis/sidecar-inertia/issues)[1 PRs](https://github.com/aarondfrancis/sidecar-inertia/pulls)MITPHPPHP ^7.2|^8.0

Since Jan 8Pushed 3y ago7 watchersCompare

[ Source](https://github.com/aarondfrancis/sidecar-inertia)[ Packagist](https://packagist.org/packages/hammerstone/sidecar-inertia)[ RSS](/packages/hammerstone-sidecar-inertia/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

Sidecar SSR for InertiaJS
=========================

[](#sidecar-ssr-for-inertiajs)

> 🚨 This is currently very much in beta!

You can see a fully working Jetstream + Inertia + Sidecar demo repo at [hammerstonedev/sidecar-inertia-demo](https://github.com/hammerstonedev/sidecar-inertia-demo).

Overview
--------

[](#overview)

This package provides a Sidecar function to run [Inertia server-side rendering](https://inertiajs.com/server-side-rendering) on AWS Lambda.

Sidecar packages, deploys, and executes AWS Lambda functions from your Laravel application.

It works with any Laravel 7 or 8 application, hosted anywhere including your local machine, Vapor, Heroku, a shared virtual server, or any other kind of hosting environment.

- [Sidecar docs](https://hammerstone.dev/sidecar/docs/main/overview)
- [Sidecar GitHub](https://github.com/hammerstonedev/sidecar)

Enabling SSR
------------

[](#enabling-ssr)

Following the [official Inertia docs](https://inertiajs.com/server-side-rendering#enabling-ssr) on enabling SSR is a good place to start, but there are a few things you can skip:

- You do not need to `npm install @inertiajs/server`
- You do not need to `npm install webpack-node-externals`
- Come back here when you get to the "Building your application" section

Make sure that `inertia/laravel-inertia` is at least version `0.5.1`.

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

[](#installation)

To require this package, run the following:

```
composer require hammerstone/sidecar-inertia
```

This will install Sidecar as well.

Using the Sidecar Gateway
-------------------------

[](#using-the-sidecar-gateway)

Update your `AppServiceProvider` to use the `SidecarGateway` as the default Inertia SSR Gateway

```
namespace App\Providers;

use Hammerstone\Sidecar\Inertia\SidecarGateway;
use Illuminate\Support\ServiceProvider;
use Inertia\Ssr\Gateway;

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        // Use Sidecar to run Inertia SSR.
        $this->app->instance(Gateway::class, new SidecarGateway);
    }
}
```

Updating Configuration
----------------------

[](#updating-configuration)

Update your `config/inertia.php` to include the Sidecar settings

```
