Skip to content

Add first-class Notion plugin with generalized oauth-bearer support #75

Closed

Description

@dcramer

Summary

Add a first-class @sentry/junior-notion plugin with a shared internal Notion integration for read-only page search and summarization.

Why

For Junior's current Notion use case, a single workspace-scoped internal integration is simpler than per-user OAuth:

  • one shared NOTION_TOKEN
  • no /notion auth flow
  • explicit access boundary through Notion page sharing
  • better fit for a single-workspace Slack assistant

We are keeping the recent oauth-bearer generalization work in core because other providers will still need provider-specific token exchange behavior, but Notion v1 itself should use the simpler internal integration model.

Scope

1) New package: @sentry/junior-notion

Add:

  • packages/junior-notion/package.json
  • packages/junior-notion/plugin.yaml
  • packages/junior-notion/README.md
  • packages/junior-notion/skills/notion/SKILL.md

Initial behavior:

  • capability: notion.api.read
  • shared internal integration token via NOTION_TOKEN
  • no per-user OAuth flow
  • /notion <query>:
    • search Notion pages
    • fetch markdown for the top page result
    • return a concise summary with the page URL

Notion defaults for v1:

  • api-domains: [api.notion.com]
  • credentials.api-headers includes Notion-Version: 2025-09-03
  • docs explain Read content and the required Add connections sharing step

2) Bearer broker behavior

  • Keep generic oauth-bearer support in core for future OAuth providers
  • When a bearer plugin omits oauth, allow it to use the shared env token even when requester context exists
  • Preserve existing per-user OAuth behavior for providers that do declare oauth

3) Docs and release surfaces

  • Add a Notion plugin docs page
  • Update plugin overview, quickstart examples, and package lists
  • Update root README package table/examples
  • Update release metadata and CI packaging for @sentry/junior-notion

Test plan

Run targeted tests:

  • pnpm --filter @sentry/junior exec vitest run tests/plugin-registry-packages.test.ts tests/oauth-callback.test.ts tests/sentry-broker.test.ts tests/jr-rpc-command.test.ts tests/state-adapter-token-store.test.ts
  • pnpm --filter @sentry/junior typecheck
  • pnpm docs:check

Acceptance criteria

  • /notion <query> works with a configured NOTION_TOKEN
  • Notion requests include the required Notion-Version header
  • Docs explain internal integration setup, Read content, and Add connections
  • Existing Sentry and GitHub behavior remains unchanged

Activity

  1. added 6 commits that reference this issue on Mar 9, 2026
    a1c488e
    2de6e6e
    4b90ea2
    18c325a
    6c24a7e
    8de1ecf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions