- Active Pyckle Pro subscription
- Notion account with admin access to the workspace
- Pyckle deployed to Fly.io
Overview
Pyckle integrates with Notion through OAuth 2.0. You create a Notion integration once, authorize it from your browser, and receive an access token. The token is per-user and scoped to the specific databases you share with the integration. Once connected, your Notion content becomes searchable alongside your codebase through the same search_code() interface.
Step 1 — Create a Notion Integration
Go to notion.so/my-integrations and click New integration.
- Name: "Pyckle" (or any name you prefer)
- Type: Public integration (required for OAuth — Internal won't work)
- Redirect URIs:
https://pyckle.co/auth/notion/callback(exact match, no trailing slash) - Capabilities: Read content, Read user information
Save the Client ID and Client Secret — you'll need both in the next step.
Step 2 — Set Credentials on Fly
Store your Notion credentials as secrets in your Fly.io deployment:
fly secrets set -a pyckle \
NOTION_CLIENT_ID= \
NOTION_CLIENT_SECRET= \
NOTION_REDIRECT_URI="https://pyckle.co/auth/notion/callback"
Step 3 — Authorize the Integration
Open this URL in your browser (replace my_workspace with any string you want to use as a state identifier):
https://pyckle.co/auth/notion?state=my_workspace
You'll be redirected to Notion's authorization page. Click Allow. On success, the response JSON includes your access_token and workspace name.
index_notion().
Step 4 — Index Your Workspace
Use the index_notion() function to index your Notion content:
index_notion(
token="ntn_xxxxx",
database_id="your_database_id" # optional: omit to index all shared databases
)
Step 5 — Share Databases with the Integration
In Notion: open each database you want indexed, click the ... menu, select Add connections, and choose your integration.
Step 6 — Search Your Notion Content
Search your indexed Notion content alongside your code:
search_code("authentication architecture decision")
Notion results appear alongside code results, tagged with source: "notion" in the result metadata.
Troubleshooting
redirect_uri_mismatch: The redirect URI in your Notion integration must exactly matchhttps://pyckle.co/auth/notion/callback— no trailing slash, nohttp://.index_notionreturns empty results: Share the target database with your integration (Step 5 above).401on auth endpoint: YourNOTION_CLIENT_IDorNOTION_CLIENT_SECRETis wrong. Re-runfly secrets set.