
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
gatsby-source-notion-api
Advanced tools
Gatsby source plugin for working with official Notion API.
Here's a Postman collection to play around with the API if you're interested: https://www.postman.com/notionhq/workspace/notion-s-public-api-workspace/overview
This is a source plugin for pulling content into Gatsby from official public Notion API (currently in beta). With this plugin, you will be able to query your Notion pages in Gatsby using GraphQL.
**$VALUE**
)_$VALUE_
)~~$VALUE~~
)<u>$VALUE</u>
)code
($VALUE
)<span notion-color="$COLOR">$VALUE</span>
)markdown-remark
and mdx
yarn add gatsby-source-notion-api
or
npm install --save gatsby-source-notion-api
Before using this plugin, make sure you
Settings & Memberships
→ Integrations
→ Develop your own integrations
,
short link to the Integrations creation section). It's
OK to use an internal one. Don't forget to copy the token:
Share
→ Select
the integration in the Invite
dropdown). Don't forget the database in the URL. It's a series of
characters after the last slash and before the question mark.
Then add this to your gatsby-config.json
:
plugins: [
{
resolve: `gatsby-source-notion-api`,
options: {
token: `$INTEGRATION_TOKEN`,
databaseId: `$DATABASE_ID`,
},
},
// ...
]
token
[string][required]
Integration token.
databaseId
[string][required]
The identifier of the database you want to get pages from. The integration identified by provided token must have access to the database with given id.
You can query for pages with notion
or grab all of them with allNotion
. The raw content of the
page is available under raw
property.
query {
allNotion {
edges {
node {
id
parent
children
internal
title
properties
archived
createdAt
updatedAt
markdown
raw
}
}
}
}
Alternatively, you can use MarkdownRemark or MDX directly:
query {
allMarkdownRemark {
edges {
node {
frontmatter {
title
}
html
}
}
}
}
id
Unique page identifier. This is not a Notion page identifier. You can get the Notion page id under raw.id
.
parent
(Node)Parend Node.
children
Blocks that belong to the page.
title
(String)Page title joined into one string.
properties
Properties of the page. An object with keys representing database columns (snake-cased), and the following value:
id
(String)Notion column id
key
(String)Readable name of the column (without snake case).
value
(*)Value of the column for the page. Might have different structure depending on the type.
type
(String)Notion type of the column.
archived
(Boolean)Boolean. Is true if the pages was marked removed but not removed permanently.
createdAt
(Date)Date of page creation.
updatedAt
(Date)Date of the last page update.
raw
(*)Untouched contents of whatever Notion API returned.
markdown
(String)Markdown contents of the page. Limited by blocks currently supported by Notion API. Unsupported blocks turn into HTML comments specifying that Notion marked this block as non-supported.
gatsby-source-notion-api
can only work with one provided database. In further
releases, all databases reachable by the Integration will be available for querying0.4.0
!0.3.0
features support for archived, createdAt, updatedAt, properties and title.Thanks for reaching to the end of the readme!
FAQs
Gatsby source plugin for official Notion.so API
The npm package gatsby-source-notion-api receives a total of 131 weekly downloads. As such, gatsby-source-notion-api popularity was classified as not popular.
We found that gatsby-source-notion-api 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.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.