Gathering detailed insights and metrics for react-schemaorg
Gathering detailed insights and metrics for react-schemaorg
Gathering detailed insights and metrics for react-schemaorg
Gathering detailed insights and metrics for react-schemaorg
npm install react-schemaorg
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (91.14%)
JavaScript (8.86%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
505 Stars
90 Commits
19 Forks
4 Watchers
3 Branches
17 Contributors
Updated on Jul 02, 2025
Latest Version
2.0.0
Package Id
react-schemaorg@2.0.0
Size
7.30 kB
NPM Version
7.15.1
Node Version
12.21.0
Published on
Jul 19, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Easily insert valid Schema.org JSON-LD in your React apps.
This library provides <JsonLd>
for plain React apps, and helmetJsonLdProp()
for use with <Helmet>
.
Uses schema-dts for Schema.org TypeScript definitions.
Note: This is not an officially supported Google product.
Install react-schemaorg
and
your desired version of
schema-dts
:
1npm install schema-dts 2npm install react-schemaorg
To insert a simple JSON-LD snippet:
1import { Person } from "schema-dts"; 2import { JsonLd } from "react-schemaorg"; 3 4export function GraceHopper() { 5 return ( 6 <JsonLd<Person> 7 item={{ 8 "@context": "https://schema.org", 9 "@type": "Person", 10 name: "Grace Hopper", 11 alternateName: "Grace Brewster Murray Hopper", 12 alumniOf: { 13 "@type": "CollegeOrUniversity", 14 name: ["Yale University", "Vassar College"], 15 }, 16 knowsAbout: ["Compilers", "Computer Science"], 17 }} 18 /> 19 ); 20}
<script>
tags (for next/head
and elsewhere)Certain <head>
management libraries require <script>
tags to be directly
included, rather than wrapped in a component. This includes NextJS's
next/head
, and react-helmet
. With these, we can use the jsonLdScriptProps
export to do the same thing:
1import { Person } from "schema-dts"; 2import { jsonLdScriptProps } from "react-schemaorg"; 3import Head from "next/head"; 4 5export default function MyPage() { 6 return ( 7 <Head> 8 <script 9 {...jsonLdScriptProps<Person>({ 10 "@context": "https://schema.org", 11 "@type": "Person", 12 name: "Grace Hopper", 13 alternateName: "Grace Brewster Murray Hopper", 14 alumniOf: { 15 "@type": "CollegeOrUniversity", 16 name: ["Yale University", "Vassar College"], 17 }, 18 knowsAbout: ["Compilers", "Computer Science"], 19 })} 20 /> 21 </Head> 22 ); 23}
To set JSON-LD in React Helmet, you need to pass it to the script={[...]}
prop
array in the Helmet
component:
1import { Person } from "schema-dts"; 2import { helmetJsonLdProp } from "react-schemaorg"; 3import { Helmet } from "react-helmet"; 4 5<Helmet 6 script={[ 7 helmetJsonLdProp<Person>({ 8 "@context": "https://schema.org", 9 "@type": "Person", 10 name: "Grace Hopper", 11 alternateName: "Grace Brewster Murray Hopper", 12 alumniOf: { 13 "@type": "CollegeOrUniversity", 14 name: ["Yale University", "Vassar College"], 15 }, 16 knowsAbout: ["Compilers", "Computer Science"], 17 }), 18 ]} 19/>;
Use NPM to install dependencies:
1npm install
Use tsc to build:
1tsc
To contribute changes, see the CONTRIBUTING.md file.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More