Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/americanexpress/react-seo
โจ Simple SEO tag manager for React
https://github.com/americanexpress/react-seo
meta one-app seo
Last synced: 4 days ago
JSON representation
โจ Simple SEO tag manager for React
- Host: GitHub
- URL: https://github.com/americanexpress/react-seo
- Owner: americanexpress
- License: apache-2.0
- Created: 2020-03-23T19:06:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T01:06:15.000Z (5 months ago)
- Last Synced: 2024-09-20T03:53:42.058Z (about 2 months ago)
- Topics: meta, one-app, seo
- Language: JavaScript
- Homepage:
- Size: 4.61 MB
- Stars: 47
- Watchers: 18
- Forks: 9
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/%40americanexpress%2Freact-seo.svg)](https://badge.fury.io/js/%40americanexpress%2Freact-seo)
[![Build Status](https://travis-ci.org/americanexpress/react-seo.svg?branch=main)](https://travis-ci.org/americanexpress/react-seo)> Simple SEO tag manager for React
## ๐ฉโ๐ป Hiring ๐จโ๐ป
Want to get paid for your contributions to `react-seo`?
> Send your resume to [email protected]## ๐ Table of Contents
* [Usage](#Usage)
* [API](#API)
* [Contributing](#Contributing)
## ๐คนโ Usage
```bash
npm install @americanexpress/react-seo
```
Let's start with a minimal example of basic usage:
```javascript
import React from 'react';
import SEO from '@americanexpress/react-seo';const MyModule = () => (
);export default MyModule;
```This will result in the following tags being added to the `head` element:
```html
Lorem Ipsum
```
Notice in the example above that the Open Graph and Twitter Card metadata is constructed from the `title`, `description`, and `image` props. To override these values or add additional tags not provided by default, you may use the `openGraph` and `twitterCard` props.
```javascript
import React from 'react';
import SEO from '@americanexpress/react-seo';const MyModule = () => (
);export default MyModule;
```
## ๐๏ธ API
The interface for `react-seo` is denoted below:
```javascript
SEO.propTypes = {
children: oneOfType([
arrayOf(node),
node,
]),
title: string,
description: string,
canonical: string,
image: shape({
src: string,
secureUrl: string,
type: string,
width: number,
height: number,
alt: string,
}),
video: shape({
src: string,
secureUrl: string,
type: string,
width: number,
height: number,
alt: string,
}),
openGraph: shape({
type: string,
url: string,
title: string,
description: string,
determiner: string,
locale: string,
localeAlternate: string,
siteName: string,
image: shape({
src: string,
secureUrl: string,
type: string,
width: number,
height: number,
alt: string,
}),
video: shape({
src: string,
secureUrl: string,
type: string,
width: number,
height: number,
alt: string,
}),
audio: shape({
src: string,
secureUrl: string,
type: string,
}),
}),
twitterCard: shape({
card: string,
title: string,
description: string,
image: shape({
src: string,
alt: string,
}),
site: string,
siteId: string,
creator: string,
creatorId: string,
app: shape({
country: string,
iphone: shape({
id: string,
url: string,
name: string,
}),
ipad: shape({
id: string,
url: string,
name: string,
}),
googlePlay: shape({
id: string,
url: string,
name: string,
}),
}),
player: shape({
src: string,
width: number,
height: number,
}),
}),
keywords: arrayOf(string),
robots: arrayOf(string),
locale: string,
meta: arrayOf(object),
siteUrl: string,
alternateLinks: arrayOf(shape({
hreflang: string,
href: string,
}))
};SEO.defaultProps = {
children: null,
article: false,
author: '',
description: '',
image: null,
keywords: [],
robots: [],
locale: 'en-US',
meta: [],
pathname: '',
siteUrl: '',
title: '',
canonical: '',
alternateLinks: [],
};
```
## ๐ Contributing
We welcome Your interest in the American Express Open Source Community on Github.
Any Contributor to any Open Source Project managed by the American Express Open
Source Community must accept and sign an Agreement indicating agreement to the
terms below. Except for the rights granted in this Agreement to American Express
and to recipients of software distributed by American Express, You reserve all
right, title, and interest, if any, in and to Your Contributions. Please [fill
out the Agreement](https://cla-assistant.io/americanexpress/react-seo).Please feel free to open pull requests and see [CONTRIBUTING.md](./CONTRIBUTING.md) for commit formatting details.
## ๐๏ธ License
Any contributions made under this project will be governed by the [Apache License
2.0](https://github.com/americanexpress/react-seo/blob/main/LICENSE.txt).## ๐ฃ๏ธ Code of Conduct
This project adheres to the [American Express Community Guidelines](https://github.com/americanexpress/react-seo/wiki/Code-of-Conduct).
By participating, you are expected to honor these guidelines.