{"id":28249111,"url":"https://github.com/romsar/gonertia","last_synced_at":"2026-04-11T17:13:14.742Z","repository":{"id":65564192,"uuid":"594760861","full_name":"romsar/gonertia","owner":"romsar","description":"The Go adapter for Inertia.js","archived":false,"fork":false,"pushed_at":"2026-03-30T20:11:41.000Z","size":734,"stargazers_count":235,"open_issues_count":3,"forks_count":14,"subscribers_count":2,"default_branch":"2.x","last_synced_at":"2026-03-30T22:10:13.550Z","etag":null,"topics":["go","golang","inertia","inertia-go","inertiajs","inertiajs-adapter","ssr"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/romsar/gonertia/v2","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romsar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-29T15:08:54.000Z","updated_at":"2026-03-24T15:52:50.000Z","dependencies_parsed_at":"2025-01-20T18:21:46.018Z","dependency_job_id":"821e3b17-9f8b-4040-9a57-0949297e6aba","html_url":"https://github.com/romsar/gonertia","commit_stats":{"total_commits":44,"total_committers":2,"mean_commits":22.0,"dds":"0.18181818181818177","last_synced_commit":"3cb265e803e97b9d3bdf69e36024332890bfd991"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/romsar/gonertia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romsar%2Fgonertia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romsar%2Fgonertia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romsar%2Fgonertia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romsar%2Fgonertia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romsar","download_url":"https://codeload.github.com/romsar/gonertia/tar.gz/refs/heads/2.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romsar%2Fgonertia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31688243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","inertia","inertia-go","inertiajs","inertiajs-adapter","ssr"],"created_at":"2025-05-19T13:14:11.505Z","updated_at":"2026-04-11T17:13:14.712Z","avatar_url":"https://github.com/romsar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gonertia\n\n\u003cimg src=\"https://user-images.githubusercontent.com/27378369/215432769-35e7b0f5-29a9-41d0-ba79-ca81e624b970.png\" style=\"width: 200px\"  alt=\"gonertia\"/\u003e\n\nGonertia is a well-tested and zero-dependency Inertia.js server-side adapter for Golang. Visit [inertiajs.com](https://inertiajs.com/) to learn more.\n\n[![Latest Release](https://img.shields.io/github/v/release/romsar/gonertia)](https://github.com/romsar/gonertia/releases)\n[![Audit Workflow](https://github.com/romsar/gonertia/actions/workflows/audit.yml/badge.svg?branch=master)](https://github.com/romsar/gonertia/actions/workflows/audit.yml?query=branch:master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/romsar/gonertia)](https://goreportcard.com/report/github.com/romsar/gonertia)\n[![Go Reference](https://godoc.org/github.com/romsar/gonertia?status.svg)](https://pkg.go.dev/github.com/romsar/gonertia)\n[![MIT license](https://img.shields.io/badge/LICENSE-MIT-orange.svg)](https://github.com/romsar/gonertia/blob/master/LICENSE)\n\n## Introduction\n\nInertia allows you to create fully client-side rendered single-page apps without the complexity that comes with modern SPAs. It does this by leveraging existing server-side patterns that you already love.\n\nThis package based on the official Laravel adapter for Inertia.js [inertiajs/inertia-laravel](https://github.com/inertiajs/inertia-laravel), supports all the features and works in the most similar way.\n\n## Roadmap\n\n- [x] Tests\n- [x] Helpers for testing\n- [x] Helpers for validation errors\n- [x] Examples\n- [x] SSR\n- [x] Inertia 2.0 compatibility\n\n## Installation\n\nInstall using `go get` command:\n\n```shell\ngo get github.com/romsar/gonertia/v2\n```\n\n## Usage\n\n### Basic example\n\nInitialize Gonertia in your `main.go`:\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"net/http\"\n\n    inertia \"github.com/romsar/gonertia\"\n)\n\nfunc main() {\n    i, err := inertia.New(rootHTMLString)\n    // i, err := inertia.NewFromFile(\"resources/views/root.html\")\n    // i, err := inertia.NewFromFileFS(embedFS, \"resources/views/root.html\")\n    // i, err := inertia.NewFromReader(rootHTMLReader)\n    // i, err := inertia.NewFromBytes(rootHTMLBytes)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Now create your HTTP server.\n    // Gonertia works well with standard http server library,\n    // but you are free to use some external routers like Gorilla Mux or Chi.\n    mux := http.NewServeMux()\n\n    mux.Handle(\"/home\", i.Middleware(homeHandler(i)))\n}\n\nfunc homeHandler(i *inertia.Inertia) http.Handler {\n    fn := func(w http.ResponseWriter, r *http.Request) {\n        err := i.Render(w, r, \"Home/Index\", inertia.Props{\n            \"some\": \"data\",\n        })\n\n        if err != nil {\n            handleServerErr(w, err)\n            return\n        }\n    }\n\n    return http.HandlerFunc(fn)\n}\n```\n\nCreate `root.html` template:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\t\u003chead\u003e\n\t\t\u003cmeta charset=\"UTF-8\" /\u003e\n\t\t\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n\t\t\u003c!-- Put here your styles, meta and other stuff --\u003e\n\t\t{{ .inertiaHead }}\n\t\u003c/head\u003e\n\n\t\u003cbody\u003e\n\t\t{{ .inertia }}\n\t\t\u003cscript type=\"module\" src=\"/build/assets/app.js\"\u003e\u003c/script\u003e\n\t\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Starter kits\n\n1. [Gonertia + Vue + Vite + Tailwind](https://github.com/hbourgeot/gonertia_vue_example)\n2. [Gonertia + Svelte + Vite + Tailwind](https://github.com/hbourgeot/gonertia_svelte_example)\n3. [Gonertia + React + Vite + Tailwind](https://github.com/sdil/gonertia_react_example)\n4. Also you can use [Alpacaproj project generator](https://github.com/JensvandeWiel/alpacaproj)\n\n### More examples\n\n#### Set asset version ([learn more](https://inertiajs.com/asset-versioning))\n\n```go\ni, err := inertia.New(\n    /* ... */\n    inertia.WithVersion(\"some-version\"), // by any string\n    inertia.WithVersionFromFile(\"./public/build/manifest.json\"), // by file checksum\n    inertia.WithVersionFromFileFS(embedFS, \"./public/build/manifest.json\"), // by file checksum from fs.FS\n)\n```\n\n#### SSR (Server Side Rendering) ([learn more](https://inertiajs.com/server-side-rendering))\n\nTo enable server side rendering you have to provide an option in place where you initialize Gonertia:\n\n```go\ni, err := inertia.New(\n/* ... */\n    inertia.WithSSR(), // default is http://127.0.0.1:13714\n    inertia.WithSSR(\"http://127.0.0.1:1234\"), // custom url http://127.0.0.1:1234\n)\n```\n\nAlso, you have to use asset bundling tools like [Vite](https://vitejs.dev/) or [Webpack](https://webpack.js.org/) (especially with [Laravel Mix](https://laravel-mix.com/)). The setup will vary depending on this choice, you can read more about it in [official docs](https://inertiajs.com/server-side-rendering) or check an [example](https://github.com/hbourgeot/gonertia_vue_example) that works on Vite.\n\n#### Optional and Always props ([learn more](https://inertiajs.com/partial-reloads))\n\n```go\nprops := inertia.Props{\n    \"optional\": inertia.Optional{func () (any, error) {\n        return \"prop\", nil\n    }},\n    \"always\": inertia.Always(\"prop\"),\n}\n\ni.Render(w, r, \"Some/Page\", props)\n```\n\n#### Merging props ([learn more](https://inertiajs.com/merging-props))\n\n```go\nprops := inertia.Props{\n    \"merging\": inertia.Merge([]int{rand.Int63()}),\n}\n```\n\n#### Deferred props ([learn more](https://inertiajs.com/deferred-props))\n\n```go\nprops := inertia.Props{\n    \"defer_with_default_group\": inertia.Defer(func () (any, error) {\n        return \"prop\", nil\n    }),\n    \"defer_with_custom_group\": inertia.Defer(\"prop\", \"foobar\"),\n    \"defer_with_merging\": inertia.Defer([]int64{rand.Int63()}).Merge(),\n}\n```\n\n#### Once props ([learn more](https://inertiajs.com/docs/v2/data-props/once-props))\n\nGonertia supports light version of Once props (feel free to send a pr with support of other features).\n\n```go\nprops := inertia.Props{\n    \"foo\": inertia.Once(\"bar\"),\n}\n```\n\n#### Infinite scrolling ([learn more](https://inertiajs.com/infinite-scroll))\n\n```go\nprops := inertia.Props{\n    // Basic scroll prop (defaults to \"data\" wrapper)\n    \"items\": inertia.Scroll(items),\n\n    // Scroll prop with custom wrapper\n    \"results\": inertia.Scroll(items, inertia.WithWrapper(\"results\")),\n\n    // Scroll prop with pagination metadata\n    \"posts\": inertia.Scroll(posts, inertia.WithMetadata(inertia.ScrollMetadata{\n        PageName:     \"page\",\n        PreviousPage: 1,\n        NextPage:     3,\n        CurrentPage:  2,\n    })),\n\n    // Scroll prop with metadata function (extracts metadata from your data structure)\n    \"articles\": inertia.Scroll(paginatedData, inertia.WithMetadataFunc(\n        func(data PaginatedData) inertia.ProvidesScrollMetadata {\n            return inertia.ScrollMetadata{\n                PageName:     \"page\",\n                CurrentPage:  data.CurrentPage,\n                NextPage:     data.NextPage,\n                PreviousPage: data.PrevPage,\n            }\n        },\n    )),\n}\n```\n\n#### Redirects ([learn more](https://inertiajs.com/redirects))\n\n```go\ni.Redirect(w, r, \"https://example.com\") // plain redirect\ni.Location(w, r, \"https://example.com\") // external redirect\n```\n\nNOTES:\nIf response is empty - user will be redirected to the previous url, just like in Laravel official adapter.\n\nTo manually redirect back, you can use `Back` helper:\n\n```go\ni.Back(w, r)\n```\n\n#### Share template data ([learn more](https://inertiajs.com/responses#root-template-data))\n\n```go\ni.ShareTemplateData(\"title\", \"Home page\")\n```\n\n```html\n\u003ch1\u003e{{ .title }}\u003c/h1\u003e\n```\n\n#### Share template func\n\n```go\ni.ShareTemplateFunc(\"trim\", strings.TrimSpace)\n```\n\n```html\n\u003ch1\u003e{{ trim \" foo bar \" }}\u003c/h1\u003e\n```\n\n#### Pass template data via context (in middleware)\n\n```go\nctx := inertia.SetTemplateData(r.Context(), inertia.TemplateData{\"foo\", \"bar\"})\n// or inertia.SetTemplateDatum(r.Context(), \"foo\", \"bar\")\n\n// pass it to the next middleware or inertia.Render function using r.WithContext(ctx).\n```\n\n#### Share prop globally ([learn more](https://inertiajs.com/shared-data))\n\n```go\ni.ShareProp(\"foo\", \"bar\")\n```\n\n#### Pass props via context (in middleware)\n\n```go\nctx := inertia.SetProps(r.Context(), inertia.Props{\"foo\": \"bar\"})\n// or inertia.SetProp(r.Context(), \"foo\", \"bar\")\n\n// pass it to the next middleware or inertia.Render function using r.WithContext(ctx).\n```\n\n#### Validation errors ([learn more](https://inertiajs.com/validation))\n\n```go\nctx := inertia.SetValidationErrors(r.Context(), inertia.ValidationErrors{\"some_field\": \"some error\"})\n// or inertia.AddValidationErrors(r.Context(), inertia.ValidationErrors{\"some_field\": \"some error\"})\n// or inertia.SetValidationError(r.Context(), \"some_field\", \"some error\")\n\n// pass it to the next middleware or inertia.Render function using r.WithContext(ctx).\n```\n\n#### Replace standard JSON marshaller\n\n1. Implement [JSONMarshaller](./json.go) interface:\n\n```go\nimport jsoniter \"github.com/json-iterator/go\"\n\ntype jsonIteratorMarshaller struct{}\n\nfunc (j jsonIteratorMarshaller) Decode(r io.Reader, v any) error {\n    return jsoniter.NewDecoder(r).Decode(v)\n}\n\nfunc (j jsonIteratorMarshaller) Marshal(v any) ([]byte, error) {\n    return jsoniter.Marshal(v)\n}\n```\n\n2. Provide your implementation in constructor:\n\n```go\ni, err := inertia.New(\n    /* ... */,\n    inertia.WithJSONMarshaller(jsonIteratorMarshaller{}),\n)\n```\n\n#### Use your logger\n\n```go\ni, err := inertia.New(\n    /* ... */\n    inertia.WithLogger(), // default logger\n    // inertia.WithLogger(somelogger.New()),\n)\n```\n\n#### Set custom container id\n\n```go\ni, err := inertia.New(\n    /* ... */\n    inertia.WithContainerID(\"inertia\"),\n)\n```\n\n#### Set flash provider\n\nUnfortunately (or fortunately) we do not have the advantages of such a framework as Laravel in terms of session management.\nIn this regard, we have to do some things manually that are done automatically in frameworks.\n\nOne of them is displaying validation errors after redirects.\nYou have to write your own implementation of `gonertia.FlashProvider` which will have to store error data into the user's session and return this data (you can get the session ID from the context depending on your application).\n\n```go\ni, err := inertia.New(\n    /* ... */\n    inertia.WithFlashProvider(flashProvider),\n)\n```\n\nSimple inmemory implementation of flash provider:\n\n```go\ntype InmemFlashProvider struct {\n    errors map[string]inertia.ValidationErrors\n    clearHistory map[string]bool\n}\n\nfunc NewInmemFlashProvider() *InmemFlashProvider {\n    return \u0026InmemFlashProvider{errors: make(map[string]inertia.ValidationErrors)}\n}\n\nfunc (p *InmemFlashProvider) FlashErrors(ctx context.Context, errors ValidationErrors) error {\n    sessionID := getSessionIDFromContext(ctx)\n    p.errors[sessionID] = errors\n    return nil\n}\n\nfunc (p *InmemFlashProvider) GetErrors(ctx context.Context) (ValidationErrors, error) {\n    sessionID := getSessionIDFromContext(ctx)\n    errors := p.errors[sessionID]\n    delete(p.errors, sessionID)\n    return errors, nil\n}\n\nfunc (p *InmemFlashProvider) FlashClearHistory(ctx context.Context) error {\n    sessionID := getSessionIDFromContext(ctx)\n    p.clearHistory[sessionID] = true\n    return nil\n}\n\nfunc (p *InmemFlashProvider) ShouldClearHistory(ctx context.Context) (bool, error) {\n    sessionID := getSessionIDFromContext(ctx)\n    clearHistory := p.clearHistory[sessionID]\n    delete(p.clearHistory, sessionID)\n    return clearHistory\n}\n```\n\n#### History encryption ([learn more](https://inertiajs.com/history-encryption))\n\nEncrypt history:\n```go\n// Global encryption:\ni, err := inertia.New(\n    /* ... */\n    inertia.WithEncryptHistory(),\n)\n\n// Pre-request encryption:\nctx := inertia.SetEncryptHistory(r.Context())\n\n// pass it to the next middleware or inertia.Render function using r.WithContext(ctx).\n```\n\nClear history:\n```go\nctx := inertia.ClearHistory(r.Context())\n\n// pass it to the next middleware or inertia.Render function using r.WithContext(ctx).\n```\n\n#### Vite Integration\n\nBuilt-in Vite integration that automatically detects hot reload vs bundled mode. By default, Vite integration assumes a standard `public/` directory structure for assets, but it can be overwritten.\n\n##### Basic Vite usage\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"net/http\"\n\n    inertia \"github.com/romsar/gonertia/v2\"\n)\n\nfunc main() {\n    // First create your Inertia instance (you can use any inertia.New* method)\n    i, err := inertia.NewFromFile(\"resources/views/app.html\")\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Then wrap it with Vite functionality\n    app, err := inertia.NewWithVite(i)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // The rest of your application setup...\n    mux := http.NewServeMux()\n    mux.Handle(\"/\", app.Middleware(homeHandler(app)))\n}\n```\n\n#### Vite configuration options\n\nAll Vite integration settings can be customized:\n\n```go\n// Create Inertia instance with any options you need\ni, err := inertia.NewFromFile(\"resources/views/app.html\",\n    inertia.WithSSR(\"http://localhost:13714\"),\n)\nif err != nil {\n    log.Fatal(err)\n}\n\n// Wrap with Vite and configure Vite-specific options\napp, err := inertia.NewWithVite(i,\n    inertia.WithHotFile(\"custom/hot\"),                           // Hot reload file path\n    inertia.WithBuildManifest(\"public/build/manifest.json\"),     // Build manifest path\n    inertia.WithFallbackManifest(\"public/.vite/manifest.json\"), // Fallback manifest\n    inertia.WithBuildDir(\"/assets/\"),                           // Build output directory\n    inertia.WithHotReloadPort(\"//localhost:3000\"),             // Hot reload server port\n)\nif err != nil {\n    log.Fatal(err)\n}\n```\n\n#### Template usage with Vite\n\nCreate your root template with Vite functions:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n    {{ .inertiaHead }}\n\n    \u003c!-- Vite Refresh - automatically handles HMR setup for React/Preact/Vue --\u003e\n    {{ viteRefresh }}\n\n    \u003c!-- Or use framework-specific helpers: --\u003e\n    \u003c!-- {{ viteReactRefresh }} - React-specific HMR with refresh runtime --\u003e\n\n    \u003c!-- CSS - automatically resolves dev vs production --\u003e\n    \u003clink rel=\"stylesheet\" href=\"{{ vite \"resources/css/app.css\" }}\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    {{ .inertia }}\n\n    \u003c!-- Main app script - automatically resolves dev vs production --\u003e\n    \u003cscript type=\"module\" src=\"{{ vite \"resources/js/app.jsx\" }}\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Vite Asset Management\n\nAutomatic asset loading with configurable preload strategies:\n\n```go\napp, err := inertia.NewVite(i,\n    inertia.WithEntryPoints(\"resources/js/app.tsx\"),\n    inertia.WithWaterfallPreload(3),\n)\n```\n\n**Template usage - Two approaches:**\n\n**Option 1: Config-based**\n```html\n\u003chead\u003e\n    {{ .inertiaHead }}\n    {{ viteAssets }}\n\u003c/head\u003e\n```\n\n**Option 2: Template arguments**\n```html\n\u003chead\u003e\n    {{ .inertiaHead }}\n    {{ viteAssets \"resources/js/app.tsx\" }}\n    {{ viteAssets \"app.js\" \"admin.js\" }}\n\u003c/head\u003e\n```\n\n**Configuration options:**\n- `WithEntryPoints(...)` - Specify entry points (required unless using template args)\n- `WithIntegrity()` - Enable SubResource Integrity (requires Vite plugin like [vite-plugin-manifest-sri](https://github.com/ElMassimo/vite-plugin-manifest-sri))\n\n**Preload strategies:**\n- `WithoutPreloading()` - Minimal output, browser handles discovery (default)\n- `WithAggressivePreload()` - Preload all dependencies immediately\n- `WithWaterfallPreload(concurrent)` - Batched prefetch with concurrency control\n\n**SubResource Integrity (SRI):**\n\nSRI hashes are automatically included in generated tags when present in the manifest. To add SRI support to your Vite build:\n\n1. Install [vite-plugin-manifest-sri](https://github.com/ElMassimo/vite-plugin-manifest-sri)\n2. Add the plugin to your `vite.config.js`\n3. The `integrity` field will be read from the manifest and added to all asset tags\n\n#### Content Security Policy (CSP)\n\n```go\nhandler := app.CSPMiddleware()(app.Middleware(mux))\n```\n\nTemplate:\n```html\n{{ viteAssetsWithNonce .csp_nonce \"app.tsx\" }}\n```\n\nCustomize:\n```go\napp.CSPMiddleware(\n    inertia.WithCSPPolicy(\"script-src 'nonce-{{nonce}}'\"),\n    inertia.WithCSPNonceGenerator(customFunc),\n)\n```\n\nReturns `func(http.Handler) http.Handler`. Nonces applied to all tags. Merges with existing CSP headers.\n\n#### Template functions\n\nThe Vite integration provides the following template functions:\n\n- **`{{ viteAssets \"entry.js\" ... }}`** - Outputs all required assets (accepts optional entry point args)\n- **`{{ viteAssetsWithNonce .csp_nonce \"entry.js\" ... }}`** - Outputs assets with CSP nonce for enhanced security\n- **`{{ vite \"path\" }}`** - Resolves asset URLs (dev vs production)\n- **`{{ viteRefresh }}`** - HMR setup for frameworks like Preact, Vue\n- **`{{ viteReactRefresh }}`** - React-specific HMR with refresh runtime\n\n#### Testing\n\nOf course, this package provides convenient interfaces for testing!\n\n```go\nfunc TestHomepage(t *testing.T) {\n    body := ... // get an HTML or JSON using httptest package or real HTTP request.\n\n    // ...\n\n    assertable := inertia.AssertFromReader(t, body) // from io.Reader body\n    // OR\n    assertable := inertia.AssertFromBytes(t, body) // from []byte body\n    // OR\n    assertable := inertia.AssertFromString(t, body) // from string body\n\n    // now you can do assertions using assertable.Assert[...] methods:\n    assertable.AssertComponent(\"Foo/Bar\")\n    assertable.AssertVersion(\"foo bar\")\n    assertable.AssertURL(\"https://example.com\")\n    assertable.AssertProps(inertia.Props{\"foo\": \"bar\"})\n    assertable.AssertEncryptHistory(true)\n    assertable.AssertClearHistory(true)\n    assertable.AssertDeferredProps(map[string][]string{\"default\": []string{\"foo bar\"}})\n    assertable.AssertMergeProps([]string{\"foo\"})\n\n    // or work with the data yourself:\n    assertable.Component // Foo/Bar\n    assertable.Version // foo bar\n    assertable.URL // https://example.com\n    assertable.Props // inertia.Props{\"foo\": \"bar\"}\n    assertable.EncryptHistory // true\n    assertable.ClearHistory // false\n    assertable.MergeProps // []string{\"foo\"}\n    assertable.Body // full response body\n}\n```\n\n## More community adapters\n\nAlso, you can check one more golang adapter called [petaki/inertia-go](https://github.com/petaki/inertia-go).\n\nFull list of community adapters is located on [inertiajs.com](https://inertiajs.com/community-adapters).\n\n## Credits\n\nThis package is based on [inertiajs/inertia-laravel](https://github.com/inertiajs/inertia-laravel) and uses some ideas of [petaki/inertia-go](https://github.com/petaki/inertia-go).\n\n## License\n\nGonertia is released under the [MIT License](http://www.opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromsar%2Fgonertia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromsar%2Fgonertia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromsar%2Fgonertia/lists"}