Skip to content

Commit d9c0e7c

Browse files
authored
Fix integration ID to follow notion updates (#19)
* use the original value to fllow the latest notion dashboard * update link text * Update README.md
1 parent c5b8d7f commit d9c0e7c

File tree

3 files changed

+19
-26
lines changed

3 files changed

+19
-26
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,36 @@ https://github.com/denkiwakame/arxiv2notion/releases/latest
2727
## ⚙️ Setup
2828

2929
### 1. Add arxiv2notion integration
30-
- follow the instruction of [Notion API](https://developers.notion.com/docs/getting-started)
31-
- navigate to [My Integrations](https://www.notion.so/my-integrations)
32-
- `+ New integration`
30+
- navigate to [My Integrations](https://www.notion.so/profile/integrations)
31+
- `+ New Integration`
3332
- **associated workspace:** select your workspace where you save arXiv articles
33+
- **Type:** select `Internal`
34+
- **name:** set any name of your choice
35+
<img src="https://github.com/user-attachments/assets/137a6dc2-e280-46d9-8f89-43c6bff9da41" height="200" />
3436

35-
<img src="doc/my_integration.png" height="200">
37+
> [!NOTE]
38+
> For more detailed information about Notion integration, please refer to the official documentation at https://developers.notion.com/docs/getting-started.
3639
3740
### 2. Configure the extension
3841
- right-click on the extension icon > `Options`
39-
- copy **integration id (not the secret token!)** (see figures below) from `https://hwww.notion.so/my-integrations/internal/${integration-id}`
42+
- copy **integration id (not the secret token!)** (see figures below) from `https://www.notion.so/my-integrations/internal/${integration-id}`
4043
- paste the `integration id` and click on `+` button.
4144
- if your entered id is valid, you can see the following callback messages.
4245

4346
> [!NOTE]
44-
> To enhance security, arxiv2notion retrieves the Notion API key on-demand through integration ID instead of storing it directly in Chrome local storage. **Please ensure you are logged into notion.so while using this extension.**
47+
> To enhance security, arxiv2notion retrieves the Notion API key (integration secrets) on-demand through integration ID instead of storing it directly in Chrome local storage. **Please ensure you are logged into notion.so while using this extension.**
4548
4649

47-
<img src="doc/integration_id.png" height="300"><img src="doc/option.png" height="300">
50+
<img src="https://github.com/user-attachments/assets/b9e5b87a-e981-4ab6-b59e-75c7c2c7c667" height="300"><img src="https://github.com/user-attachments/assets/d82a0b37-fdc3-44b4-a89f-31997b36a19e" height="300">
4851

4952
### 3. Create databases in Notion
5053
#### from template (recommended)
5154
- clone the public template [here](https://denkiwakame.notion.site/597cdd58bded4375b1cbe073b2ed6f5d?v=63fcbfda57824b239b66e52dde841cdf) to your own notion workspace
52-
- add connection to target databases via `...` > `+ Add connections` > `arxiv2notion`
55+
- add connection to target databases via `...` > (scroll down...) `Connect to` > `{your integration name}`
5356

54-
![invite_integration](doc/connection.png)
57+
<img src="https://github.com/user-attachments/assets/1535ef61-749c-4670-8c37-57ac3d5240b4" height="400">
5558

56-
- you can switch multiple DBs by adding the connection to these pages, respectively.
59+
- Integration will have access writes to all child DBs.
5760

5861
![multiple_db](doc/multiple_db.png)
5962

src/html/options.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<a
99
class="uk-link-text"
1010
target="_blank"
11-
href="https://www.notion.so/my-integrations/"
11+
href="https://www.notion.so/profile/integrations/"
1212
uk-tooltip="title: Get integration ID; pos:right"
13-
>https://www.notion.so/my-integrations/</a
13+
>https://www.notion.so/profile/integrations/</a
1414
>
1515
<div class="uk-inline">
1616
<button

src/js/options.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,16 @@ class TokenManager {
4040
if (!chrome.storage) return;
4141
chrome.storage.local.get(this.storageKey, (d) => {
4242
if (!d) return;
43-
this.input.value = this.toIid(d.botId);
43+
this.input.value = d.botId;
4444
});
4545
}
46-
toIid(botId) {
47-
return botId.replaceAll('-', '');
48-
}
49-
toBotId(iid) {
50-
return `${iid.slice(0, 8)}-${iid.slice(8, 12)}-${iid.slice(
51-
12,
52-
16
53-
)}-${iid.slice(16, 20)}-${iid.slice(20, iid.length)}`;
54-
}
5546
async saveIntegrationId() {
56-
const iid = this.input.value;
57-
if (!iid.trim().length || iid.length != 32) {
47+
const botId = this.input.value;
48+
if (!botId.trim().length || botId.length != 36) {
5849
console.log('invalid!');
59-
this.renderMessage('danger', 'Invalid integration ID (32 char).');
50+
this.renderMessage('danger', 'Invalid integration ID (36 char).');
6051
return;
6152
}
62-
const botId = this.toBotId(iid);
6353
console.log(botId);
6454
await chrome.storage.local.set({
6555
botId: botId,

0 commit comments

Comments
 (0)