@notionhq/apps 0.0.6 → 0.0.7

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 CHANGED
@@ -14,6 +14,12 @@ import { triggers } from "@notionhq/apps/triggers";
14
14
  import { createWorkflow } from "@notionhq/apps/workflow";
15
15
  ```
16
16
 
17
+ ## Notion API access
18
+
19
+ Use `context.notion` for Notion API calls. Deployed apps receive Notion API
20
+ credentials automatically, so do not configure or push `NOTION_API_TOKEN`.
21
+ Local execution needs the token in `.env` before making a Notion API request.
22
+
17
23
  ## Database syncs
18
24
 
19
25
  Apps declare a database schema, and users attach a real Notion database to it. Apps SDK
package/dist/context.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Client } from "@notionhq/client";
2
- const FIX_STEPS = "\n\nTo fix this:\n1. Create a personal access token at https://app.notion.com/developers/tokens\n2. Add NOTION_API_TOKEN=<your-token> to your .env file\n3. For deployed apps, run: ntn apps env push";
2
+ const LOCAL_FIX_STEPS = "\n\nFor local execution:\n1. Create a personal access token at https://app.notion.com/developers/tokens\n2. Add NOTION_API_TOKEN=<your-token> to your .env file\n\nDeployed apps receive Notion API credentials automatically. Do not push NOTION_API_TOKEN.";
3
3
  function missingTokenMessage() {
4
- return "NOTION_API_TOKEN is not set. context.notion requires an API token to make requests from app capabilities to Notion." + FIX_STEPS;
4
+ return "NOTION_API_TOKEN is not set. context.notion requires an API token when an app capability runs locally." + LOCAL_FIX_STEPS;
5
5
  }
6
6
  function createUnauthenticatedNotionProxy() {
7
7
  return new Proxy({}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/apps",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "An SDK for building workflow apps for Notion",
5
5
  "license": "MIT",
6
6
  "bin": {
package/src/context.ts CHANGED
@@ -6,17 +6,17 @@ export type CapabilityContext = {
6
6
  notion: Client;
7
7
  };
8
8
 
9
- const FIX_STEPS =
10
- "\n\nTo fix this:\n" +
9
+ const LOCAL_FIX_STEPS =
10
+ "\n\nFor local execution:\n" +
11
11
  "1. Create a personal access token at https://app.notion.com/developers/tokens\n" +
12
- "2. Add NOTION_API_TOKEN=<your-token> to your .env file\n" +
13
- "3. For deployed apps, run: ntn apps env push";
12
+ "2. Add NOTION_API_TOKEN=<your-token> to your .env file\n\n" +
13
+ "Deployed apps receive Notion API credentials automatically. Do not push NOTION_API_TOKEN.";
14
14
 
15
15
  function missingTokenMessage(): string {
16
16
  return (
17
17
  "NOTION_API_TOKEN is not set. " +
18
- "context.notion requires an API token to make requests from app capabilities to Notion." +
19
- FIX_STEPS
18
+ "context.notion requires an API token when an app capability runs locally." +
19
+ LOCAL_FIX_STEPS
20
20
  );
21
21
  }
22
22