Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gatsby-source-notion-article
Advanced tools
Gatsby source plugin to import articles made in Notion
A Gatsby source plugin for importing articles made in Notion into your Gatsby application using Notion API.
⚠️ The Notion API being still in beta, some limitations may exist. Feel free to open a discussion or ask for a new feature.
# using npm
npm install gatsby-source-notion-article
# using yarn
yarn add gatsby-source-notion-article
Create a new integration. It will give you access to a token that will be used in Gatsby Source Notion Article. Once it's created, copy your token and keep it for the next step.
Duplicate this article database template to ensure your articles follows the same format as this plugin. Don't forget to share this new database with the integration you just created.
Create an .env file at the root of your Gatsby project. You can copy-paste the .env.example
from this Github repository.
https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
|--------- Database ID --------|
NOTION_KEY=<your-notion-token>
NOTION_DATABASE_ID=<your-notion-database-id>
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-notion-article`,
options: {
// Learn about environment variables: https://gatsby.dev/env-vars
token: process.env.NOTION_KEY, // required
databaseId: process.env.NOTION_DATABASE_ID, // required
params: {
page_size: 3, // optional, default is 100
filter: {} // optional
sort: {
} // optional
}
}
},
],
}
Name | Type | Default | Description |
---|---|---|---|
token | string | [required] The token from Notion could be find on your integration | |
databaseId | string | [required] The databaseId is the alphanumerical value following the name of your workspace in the sharing URL. | |
params | object | The params object | |
params.page_size | number | 100 | How many articles you want Notion to query |
params.filter | object | An object with filters passed to Notion | |
params.sort | object | An option with sort options passed to Notion | |
debug | boolean | false | Enable the debug mode for Notion |
unsupported | boolean | false | Shows in the body a message if the block is not supported. This can be enable only in development mode. |
The Notion API being in beta, only some block elements are currently supported:
{
allNotionArticles {
edges {
node {
id
title
body
createdAt
updatedAt
}
}
}
}
{
notionArticles {
id
title
body
createdAt
updatedAt
}
}
Check our example project of the Gatsby plugin implementation.
// Quick example
const Component = {
const data = useStaticQuery(graphql`
query Notion {
notionArticles {
body
}
}
`);
return (
<div dangerouslySetInnerHTML={{ __html: data.notionArticles.body }} />
);
};
If you've ever wanted to contribute to open source, and a great cause, now is your chance!
See the contributing docs for more information.
Feel free to open a discussion if you have any question or suggestion in regards to this plugin.
Thanks goes to these wonderful people
David Dias 💻 📖 🚇 ⚠️ |
(emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Gatsby source plugin to import articles made in Notion
The npm package gatsby-source-notion-article receives a total of 1 weekly downloads. As such, gatsby-source-notion-article popularity was classified as not popular.
We found that gatsby-source-notion-article demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.