Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/INSTRUCTIONS.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ worker.oauth("googleAuth", { name: "my-google-auth", provider: "google" });
- All `execute` handlers receive a Notion SDK client in the second argument as `context.notion`.

- For user-managed OAuth, supply `name`, `authorizationEndpoint`, `tokenEndpoint`, `clientId`, `clientSecret`, and `scope` (optional: `authorizationParams`, `callbackUrl`, `accessTokenExpireMs`).
- After deploying a worker with an OAuth capability, the user must configure their OAuth provider's redirect URL to match the one assigned by Notion. Run `ntn workers oauth show-redirect-url` to get the redirect URL, then set it in the provider's OAuth app settings. **Always remind the user of this step after deploying any OAuth capability.**

### Sync
#### Strategy and Pagination
Expand Down
2 changes: 2 additions & 0 deletions .agents/INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const myOAuth = worker.oauth("myOAuth", {

The OAuth capability allows you to perform the three legged OAuth flow after specifying parameters of your OAuth client: `name`, `authorizationEndpoint`, `tokenEndpoint`, `clientId`, `clientSecret`, and `scope` (optional: `authorizationParams`, `callbackUrl`, `accessTokenExpireMs`).

After deploying a worker with an OAuth capability, the user must configure their OAuth provider's redirect URL to match the one assigned by Notion. Run `ntn workers oauth show-redirect-url` to get the redirect URL, then set it in the provider's OAuth app settings. **Always remind the user of this step after deploying any OAuth capability.**

### Other capabilities

There are additional capability types in the SDK but these are restricted to a private alpha. Only Agent tools and OAuth are generally available.
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ worker.oauth("githubAuth", {
});
```

Start the OAuth flow:
After deploying, get your redirect URL and add it to your OAuth provider's app settings:

```shell
ntn workers oauth show-redirect-url
```

Then start the OAuth flow:

```shell
ntn workers oauth start githubAuth
Expand Down Expand Up @@ -291,6 +297,9 @@ ntn workers runs logs <runId>
# Start OAuth flow
ntn workers oauth start <oauthName>

# Show OAuth redirect URL (set this in your provider's app settings)
ntn workers oauth show-redirect-url

# Display help for all commands
ntn --help
```
Expand Down