Skip to content

Commit 2ac0c55

Browse files
authored
Merge pull request #10 from mogery/mog/notion
feat(notion): add data provider
2 parents 3e554fd + b7650de commit 2ac0c55

File tree

6 files changed

+432
-1
lines changed

6 files changed

+432
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ The following connectors are currently available:
2727
- ✅ Files (.md, .txt, .pdf, .csv)
2828
- ✅ GitHub (Private and Public repos)
2929
- ✅ Google Drive
30+
- ✅ Notion (pages, [need to grant access](https://github.com/mendableai/data-connectors/issues/8#issuecomment-1917829463))
3031
- ✅ Text
3132
- ✅ Web Scraper (single urls, sitemap)
3233
- ✅ Zendesk
3334
- 🔄 Confluence (In progress)
3435
- 🔄 Jira (In progress)
35-
- 🔄 Notion (In progress)
3636
- 🔄 YouTube (In progress)
3737

3838
We are working hard on transitioning all of our connectors to this repository. If you need a connector that is not available here, please open an issue or submit a PR.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
},
6060
"dependencies": {
6161
"@nangohq/node": "^0.36.100",
62+
"@notionhq/client": "^2.2.14",
6263
"@octokit/auth-oauth-user": "^4.0.1",
6364
"axios": "^1.6.5",
6465
"cheerio": "^1.0.0-rc.12",

pnpm-lock.yaml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { createDataConnector } from "../../../DataConnector";
2+
import dotenv from "dotenv";
3+
dotenv.config();
4+
5+
test(
6+
"Notion Provider Testing",
7+
async () => {
8+
const notionDataConnector = createDataConnector({
9+
provider: "notion",
10+
});
11+
12+
if (!process.env.NANGO_CONNECTION_ID_TEST) {
13+
throw new Error(
14+
"Please specify the NANGO_CONNECTION_ID_TEST environment variable."
15+
);
16+
}
17+
18+
await notionDataConnector.authorizeNango({
19+
nango_connection_id: process.env.NANGO_CONNECTION_ID_TEST,
20+
});
21+
22+
const pages = await notionDataConnector.getDocuments();
23+
expect(pages.length).toBeGreaterThan(0);
24+
pages.forEach((page) => {
25+
expect(page.provider).toBe("notion");
26+
expect(page.type).toBe("page");
27+
expect(page.content).not.toBe(null);
28+
expect(page.createdAt).not.toBe(undefined);
29+
expect(page.updatedAt).not.toBe(undefined);
30+
expect(page.metadata.sourceURL).not.toBe(null);
31+
});
32+
},
33+
30 * 1000
34+
); // 30 seconds

0 commit comments

Comments
 (0)