Notion Plugin
The Notion plugin uses a shared internal integration so Slack users can search shared Notion pages and data sources through /notion.
Create an internal Notion integration
Section titled “Create an internal Notion integration”Start with Notion’s Authorization guide, then create an internal integration in the Notion integrations dashboard. Notion’s docs describe internal integrations as single-workspace integrations that authenticate with one integration token rather than OAuth.
After you create the integration:
- Open the
Configurationtab. - Copy the integration secret.
- Set it in your host environment as
NOTION_TOKEN.
Enable the required Notion capability
Section titled “Enable the required Notion capability”Open the integration’s Capabilities tab and enable Read content.
Junior’s Notion workflow searches pages and data sources, retrieves page markdown, and queries data source rows, so Read content is the required content capability. Notion documents capability requirements here:
Register the plugin in Junior
Section titled “Register the plugin in Junior”Install and register the plugin package:
import { withJunior } from "@sentry/junior/config";
export default withJunior({ pluginPackages: ["@sentry/junior-notion"],});Set the integration token in your host environment:
NOTION_TOKEN
Share pages and data sources with the integration
Section titled “Share pages and data sources with the integration”Notion internal integrations only see the pages and data sources that are explicitly shared with them. Notion’s docs describe this as a manual sharing step:
- Open the page or data source in Notion.
- Click the
•••menu in the upper right. - Choose
Add connections. - Select your integration.
This is the most common reason /notion returns no matches or a 404/permission-style error from the Notion API.
Runtime usage flow
Section titled “Runtime usage flow”- Admin configures
NOTION_TOKENonce. - Admin shares the relevant pages or data sources with the integration in Notion.
- Users run
/notion <query>in Slack.
Verify
Section titled “Verify”NOTION_TOKENis set in the host environment.- The target page or data source is shared with the integration in Notion.
- A real
/notion <query>request returns a summary and source URL.
Failure modes
Section titled “Failure modes”- No search matches: the page or data source may not be shared with the integration yet, or Notion search may still be indexing immediately after content was shared.
403from Notion: the integration is missingRead content.401from Notion:NOTION_TOKENis missing or invalid.- Retrieval errors: the top matching page or data source could not be fetched for summarization.
Notion’s search docs note that directly shared pages are guaranteed to appear, while newly shared content can still be delayed by search indexing. If a page or data source was just shared and /notion still misses it, retry once indexing catches up.
Next step
Section titled “Next step”Review Credentials & OAuth and Security Hardening.