Skip to content

Notion Plugin

The Notion plugin uses a shared internal integration so Slack users can search shared Notion pages and data sources through /notion.

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:

  1. Open the Configuration tab.
  2. Copy the integration secret.
  3. Set it in your host environment as NOTION_TOKEN.

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:

Install and register the plugin package:

next.config.mjs
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:

  1. Open the page or data source in Notion.
  2. Click the ••• menu in the upper right.
  3. Choose Add connections.
  4. Select your integration.

This is the most common reason /notion returns no matches or a 404/permission-style error from the Notion API.

  1. Admin configures NOTION_TOKEN once.
  2. Admin shares the relevant pages or data sources with the integration in Notion.
  3. Users run /notion <query> in Slack.
  • NOTION_TOKEN is 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.
  • 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.
  • 403 from Notion: the integration is missing Read content.
  • 401 from Notion: NOTION_TOKEN is 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.

Review Credentials & OAuth and Security Hardening.