@notionhq/custom-blocks 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -10
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,14 +3,9 @@
|
|
|
3
3
|
> [!NOTE]
|
|
4
4
|
> **Pre-release.** Custom blocks are in alpha. Breaking changes may land at any time.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
access to the internet. A local `postMessage` bridge connects the block to
|
|
10
|
-
Notion.
|
|
11
|
-
|
|
12
|
-
This package provides the sandbox side of the bridge. It exports a
|
|
13
|
-
framework-neutral TypeScript API and typed React hooks.
|
|
6
|
+
Custom blocks let you build custom UI inside Notion that uses workspace data.
|
|
7
|
+
This SDK provides APIs to read and update data the viewer can access. It
|
|
8
|
+
includes framework-neutral TypeScript APIs and React hooks.
|
|
14
9
|
|
|
15
10
|
## Bundle tooling
|
|
16
11
|
|
|
@@ -130,9 +125,25 @@ Each page covers one API category. Import framework-neutral APIs from
|
|
|
130
125
|
- [`docs/errors.md`](./docs/errors.md) — request results, error format, error codes, retries, and initialization failures.
|
|
131
126
|
- [`docs/deployment.md`](./docs/deployment.md) — worker-backed deploys, localhost self-hosted fallback, where the manifest comes from.
|
|
132
127
|
|
|
133
|
-
##
|
|
128
|
+
## Limitations
|
|
129
|
+
|
|
130
|
+
Custom blocks run in sandboxed iframes. A block cannot navigate the top-level
|
|
131
|
+
page, call `window.open`, or start an authentication redirect.
|
|
132
|
+
|
|
133
|
+
By default, a block cannot request external origins. A workspace owner can allow
|
|
134
|
+
specific HTTPS origins under **Settings → Notion AI → Workers → Manage → Custom
|
|
135
|
+
block external network access**. To allow subdomains, add a wildcard origin such
|
|
136
|
+
as `https://*.example.com`. Add `https://example.com` separately if the block
|
|
137
|
+
also needs the base domain. The allowlist applies to every custom block in the
|
|
138
|
+
workspace. For `fetch` or `XMLHttpRequest`, an external API must allow the block's
|
|
139
|
+
origin through CORS.
|
|
140
|
+
|
|
141
|
+
When a custom block makes repeated requests to an external API, consider its
|
|
142
|
+
rate limits. Consider batching requests or caching results to reduce unnecessary
|
|
143
|
+
calls. If the API returns 429, follow its retry guidance.
|
|
134
144
|
|
|
135
|
-
|
|
145
|
+
Never put API secrets in a block bundle. Store them in the Worker. Read more in
|
|
146
|
+
the [custom block security guide](https://developers.notion.com/custom-blocks/guides/security).
|
|
136
147
|
|
|
137
148
|
## Bridge protocol
|
|
138
149
|
|
package/dist/version.js
CHANGED