{"id":13438043,"url":"https://github.com/denvned/isomorphic-relay","last_synced_at":"2025-10-06T02:04:13.610Z","repository":{"id":53940148,"uuid":"45913579","full_name":"denvned/isomorphic-relay","owner":"denvned","description":"Adds server side rendering support to React Relay","archived":false,"fork":false,"pushed_at":"2017-10-27T13:36:21.000Z","size":69,"stargazers_count":243,"open_issues_count":4,"forks_count":49,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-10-06T02:02:51.861Z","etag":null,"topics":["isomorphic","isomorphic-relay","relay"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denvned.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}},"created_at":"2015-11-10T13:29:44.000Z","updated_at":"2025-07-07T12:27:09.000Z","dependencies_parsed_at":"2022-08-13T05:10:24.636Z","dependency_job_id":null,"html_url":"https://github.com/denvned/isomorphic-relay","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/denvned/isomorphic-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denvned%2Fisomorphic-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denvned%2Fisomorphic-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denvned%2Fisomorphic-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denvned%2Fisomorphic-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denvned","download_url":"https://codeload.github.com/denvned/isomorphic-relay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denvned%2Fisomorphic-relay/sbom","scorecard":{"id":334544,"data":{"date":"2025-08-11","repo":{"name":"github.com/denvned/isomorphic-relay","commit":"0e0840d129bb62f785159fd969ae546274f8650f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T04:24:48.181Z","repository_id":53940148,"created_at":"2025-08-18T04:24:48.181Z","updated_at":"2025-08-18T04:24:48.181Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547821,"owners_count":26004775,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["isomorphic","isomorphic-relay","relay"],"created_at":"2024-07-31T03:01:02.445Z","updated_at":"2025-10-06T02:04:13.578Z","avatar_url":"https://github.com/denvned.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","Code Design"],"sub_categories":["Uncategorized","Isomorphic Apps"],"readme":"Isomorphic React Relay [![npm version][npm-badge]][npm]\n======================\n\nEnables server-side rendering of [React Relay](https://facebook.github.io/relay/) containers.\n\nIf you use [react-router-relay](https://github.com/relay-tools/react-router-relay)\nyou might also become interested in\n[isomorphic-relay-router](https://github.com/denvned/isomorphic-relay-router).\n\nAcknowledgments\n---------------\n\nThank you to everyone who helped in the development of this project with suggestions,\ntesting, reported issues, pull-requests. Thank you to the Facebook employees who reviewed\nmy [contributions](https://github.com/facebook/relay/commits/master?author=denvned)\nto Relay, which helped to improve the server-side rendering support.\n\nInstallation\n------------\n\n    npm install --save isomorphic-relay\n\nHow to Use\n----------\n\nHere is an example with detailed comments of how *isomorphic-relay*\ncan be used **on the server:**\n```jsx\nimport IsomorphicRelay from 'isomorphic-relay';\n\nconst rootContainerProps = {\n  Container: MyContainer,\n  queryConfig: new MyRoute(),\n};\n\napp.get('/', (req, res, next) =\u003e {\n  // Create a Relay network layer. Note that on the server you need to specify\n  // the absolute URL of your GraphQL server endpoint.\n  // Here we also pass the user cookies on to the GraphQL server to allow them\n  // to be used there, e.g. for authentication.\n  const networkLayer = new Relay.DefaultNetworkLayer(\n    'http://localhost:8080/graphql',\n    { headers: { cookie: req.headers.cookie } },\n  );\n\n  // Use IsomorphicRelay.prepareData() to prefetch the data required for\n  // rendering of the Relay container.\n  IsomorphicRelay.prepareData(rootContainerProps, networkLayer).then(({ data, props }) =\u003e {\n    // Use \u003cIsomorphicRelay.Renderer\u003e to render your Relay container when the data is ready.\n    // Note that we cannot use the standard \u003cRelay.Renderer\u003e because at the first render\n    // it renders an empty/loading screen even when all the required data is already available.\n    // Unlike that, \u003cIsomorphicRelay.Renderer\u003e in that case renders normally right at\n    // the first render, and it is important for server side rendering\n    // where we do not have a second render.\n    const reactOutput = ReactDOMServer.renderToString(\n      \u003cIsomorphicRelay.Renderer {...props} /\u003e\n    );\n\n    // To allow the data to be reused in the browser, serialize and embed it\n    // in the page together with the React markup.\n    res.render('index.ejs', {\n      preloadedData: JSON.stringify(data),\n      reactOutput\n    });\n  }).catch(next);\n});\n```\n\nAnd here is an example of the code that can be used **in the browser:**\n```jsx\nimport IsomorphicRelay from 'isomorphic-relay';\n\nconst environment = new Relay.Environment();\nenvironment.injectNetworkLayer(new Relay.DefaultNetworkLayer('/graphql'));\n\n// Deserialize the data preloaded on the server.\nconst data = JSON.parse(document.getElementById('preloadedData').textContent);\n\n// Use IsomorphicRelay.injectPreparedData() to inject the data into the Relay cache,\n// so Relay doesn't need to make GraphQL requests to fetch the data.\nIsomorphicRelay.injectPreparedData(environment, data);\n\n// Use IsomorphicRelay.prepareInitialRender() to wait until all the required data\n// is ready for rendering of the Relay container.\n// Note that it is important to use the same rootContainerProps as on the server to\n// avoid additional GraphQL requests.\nIsomorphicRelay.prepareInitialRender({ ...rootContainerProps, environment }).then(props =\u003e {\n  // Use \u003cIsomorphicRelay.Renderer\u003e to render your Relay container when the data is ready.\n  // Like on the server we cannot use the standard \u003cRelay.Renderer\u003e, bacause here\n  // we also need to render normally right at the initial render, otherwise we would get\n  // React markup mismatch with the markup prerendered on the server.\n  ReactDOM.render(\u003cIsomorphicRelay.Renderer {...props} /\u003e, document.getElementById('root'));\n});\n```\n\nAlso see the [Star Wars](examples/star-wars) example.\n\n[npm-badge]: https://img.shields.io/npm/v/isomorphic-relay.svg\n[npm]: https://www.npmjs.com/package/isomorphic-relay\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenvned%2Fisomorphic-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenvned%2Fisomorphic-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenvned%2Fisomorphic-relay/lists"}