{"id":21700136,"url":"https://github.com/wp-digital/aws-lambda-prerender","last_synced_at":"2025-10-28T01:33:47.012Z","repository":{"id":89957953,"uuid":"280410972","full_name":"wp-digital/aws-lambda-prerender","owner":"wp-digital","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-12T09:12:23.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-08T18:49:05.235Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-digital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-07-17T11:49:36.000Z","updated_at":"2025-03-12T09:12:28.000Z","dependencies_parsed_at":"2024-11-13T15:37:06.612Z","dependency_job_id":null,"html_url":"https://github.com/wp-digital/aws-lambda-prerender","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Faws-lambda-prerender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Faws-lambda-prerender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Faws-lambda-prerender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Faws-lambda-prerender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-digital","download_url":"https://codeload.github.com/wp-digital/aws-lambda-prerender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573448,"owners_count":21126832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-25T20:13:00.296Z","updated_at":"2025-10-28T01:33:41.992Z","avatar_url":"https://github.com/wp-digital.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Lambda Prerender\n\n### Description\n\nAWS Lambda function for generating HTML for client-side rendered content.\n\n### WordPress\n\nInitially this function was created to be used with WordPress via plugin [AWS Lambda Prerender](https://github.com/innocode-digital/wp-prerender-aws-lambda),\nso you just need to install plugin.\n\n### Basic usage (non WordPress)\n\nEvent JSON:\n\n| **Name** | **Type** | **Description**                                                                                                  |\n|----------|----------|------------------------------------------------------------------------------------------------------------------|\n| type | `string` | Type of content, e.g. `post` or `frontpage`                                                                      |\n| id | `string`  | Identifier, e.g. ID of Post from database.                                                                       |\n| url | `string` | URL for grabbing HTML.                                                                                           |\n| variable | `string` | Name of global variable with rendered HTML to string.                                                          |\n| selector | `string` | Selector of root element to grab. Not used for grabbing when `variable` set but always in use to detect page load. |\n| return_url | `string` | Endpoint where result should be returned.                                                                        |\n| secret | `string` | Secret to be added to POST callback request.                                                                     |\n| version | `string` | Version of HTML.                                                                                                 |\n\n#### Notes\n\n- Idea of `variable` is to use e.g. [renderToString](https://reactjs.org/docs/react-dom-server.html#rendertostring) from\n  React to render HTML otherwise element's HTML with `selector` will be used.\n- Secret is for authorization. In WordPress plugin this secret has 20 minutes live time\n  ([15 minutes](https://aws.amazon.com/ru/about-aws/whats-new/2018/10/aws-lambda-supports-functions-that-can-run-up-to-15-minutes/#:~:text=You%20can%20now%20configure%20your,Lambda%20function%20was%205%20minutes.)\n  is a maximum execution time of AWS Lambda function and 5 minutes of reserve).\n\nExample:\n\n````\n{\n  \"type\": \"post\",\n  \"id\": 345,\n  \"url\": \"https://www.site.com/blog/hello-world/\",\n  \"variable\": \"prerender\",\n  \"selector\": \"#app\",\n  \"return_url\": \"https://site.com/api/v1/prerender\",\n  \"secret\": \"aQ3qnPPnDwhaB7pzI3Y0jQx*\",\n  \"version\": \"381d3e8bfd139596baf7959fb85b084e\"\n}\n````\n\n### Installation\n\n- **Use this template** from Github.\n- [Create AWS Access Keys](https://www.serverless.com/framework/docs/providers/aws/guide/credentials#creating-aws-access-keys).\n  You can follow [this gist](https://gist.github.com/ServerlessBot/7618156b8671840a539f405dea2704c8) to create policy.\n- Add **API Key** \u0026 **Secret** with **Region** to Github **Repository secrets** into `AWS_ACCESS_KEY_ID`,\n  `AWS_SECRET_ACCESS_KEY` and `AWS_REGION` variables.\n- Deploy function with Github Actions. `dev` branch will be deployed on push into **prerender-dev-render** function,\n  production should be deployed manually through `workflow_dispatch` into **prerender-production-render**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-digital%2Faws-lambda-prerender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-digital%2Faws-lambda-prerender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-digital%2Faws-lambda-prerender/lists"}