Seneca Notion-Provider is a plugin for Seneca
Provides access to the Notion API using the Seneca provider convention. Notion API entities are represented as Seneca entities so that they can be accessed using the Seneca entity API and messages.
See seneca-entity and the Seneca Data Entities Tutorial for more details on the Seneca entity API.
NOTE: underlying third party SDK needs to be replaced as out of date and has a security issue.
This open source module is sponsored and supported by Voxgig. |
---|
Quick Example
// Setup - get the key value (<SECRET>) separately from a vault or
// environment variable.
Seneca()
// Get API keys using the seneca-env plugin
.use('env', {
var: {
$NOTION_TOKEN: String,
}
})
.use('provider', {
provider: {
notion: {
keys: {
authToken: {
value: '$NOTION_TOKEN'
},
}
}
}
})
.use('notion-provider')
let pageId = await seneca.entity('provider/notion/page')
.load$('<notion_page_id>');
Console.log('PAGE', pageId)
pageId.properties.checkMe.checkbox = false;
pageId = await pageId.save$()
Console.log('UPDATED PAGE', pageId)
Install
$ npm install @seneca/notion-provider @seneca/env
Options
None.
Action Patterns
- "role":"entity","base":"notion","cmd":"list","name":"database","zone":"provider"
- "role":"entity","base":"notion","cmd":"list","name":"page","zone":"provider"
- "role":"entity","base":"notion","cmd":"load","name":"database","zone":"provider"
- "role":"entity","base":"notion","cmd":"load","name":"page","zone":"provider"
- "role":"entity","base":"notion","cmd":"save","name":"database","zone":"provider"
- "role":"entity","base":"notion","cmd":"save","name":"page","zone":"provider"
- "sys":"provider","get":"info","provider":"notion"
Action Descriptions
"role":"entity","base":"notion","cmd":"list","name":"database","zone":"provider"
»
« No description provided.
"role":"entity","base":"notion","cmd":"list","name":"page","zone":"provider"
»
« List Noion page data into an entity.
Replies With
{}
"role":"entity","base":"notion","cmd":"load","name":"database","zone":"provider"
»
« No description provided.
"role":"entity","base":"notion","cmd":"load","name":"page","zone":"provider"
»
« Load Notion page data into an entity.
Replies With
{}
"role":"entity","base":"notion","cmd":"save","name":"database","zone":"provider"
»
« No description provided.
"role":"entity","base":"notion","cmd":"save","name":"page","zone":"provider"
»
« Update/Save Notion page data into an entity.
Replies With
{}
"sys":"provider","get":"info","provider":"notion"
»
« Get information about the Notion SDK.
More Examples
Motivation
Support
Check out our sponsors and supporters, Voxgig, on their website here.
API
Contributing
The SenecaJS org encourages participation. If you feel you can help in any way, be it with bug reporting, documentation, examples, extra testing, or new features, feel free to create an issue, or better yet - submit a Pull Request. For more information on contribution, please see our Contributing Guide.
Background
Check out the SenecaJS roadmap here!