auth-guide

Configure third-party API key and OAuth authentication for Notion Workers.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/Duckshot-Productions/ntn-worker --skill auth-guide-duckshot-productions
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: auth-guide
Source: https://github.com/Duckshot-Productions/ntn-worker/tree/main/.agents/skills/auth-guide
Command: npx skills add https://github.com/Duckshot-Productions/ntn-worker --skill auth-guide-duckshot-productions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up credentials for external services (GitHub, Stripe, Google, etc.) inside a Notion Worker involves choosing between API keys and OAuth, managing secrets, and handling redirect URLs — this guide walks through each decision and step so authentication works both locally and after deployment. ## Core Features & Use Cases - Decision Framework: Mechanically choose between personal API keys/PATs and OAuth based on what the provider offers and whether the worker should depend on one person's credential. - API Key Setup: Store tokens in .env, read them via process.env in execute, test with curl, and push secrets with ntn workers env push. - OAuth Setup: Declare worker.oauth(), register an OAuth app, configure the redirect URL from ntn workers oauth show-redirect-url, and run the flow with ntn workers oauth start. - Use Case: You are building a sync that pulls GitHub issues into Notion. The guide tells you to use a personal access token, add it to .env as GITHUB_API_TOKEN, verify it with curl, then push it before deploying. ## Quick Start Ask the assistant to set up authentication for the external service your Notion Worker integrates with, and it will recommend API key or OAuth and walk through the setup steps.

Frequently Asked Questions about auth-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an API key to a Notion Worker?▼

Add the token to a `.env` file (e.g., `GITHUB_API_TOKEN=<token>`), read it inside `execute` via `process.env.GITHUB_API_TOKEN`, then run `ntn workers env push` so the deployed worker receives the secret. Test locally first with `ntn workers exec <capability> --local`.

Should I use an API key or OAuth for my worker integration?▼

Prefer a personal API key or PAT when the provider offers one, since it is the simplest fit for an individual-scoped worker. Use OAuth when the service is OAuth-only or when the worker should not depend on one person's credential.

How do I set up OAuth in a Notion Worker?▼

Declare `worker.oauth()` with the provider's authorization and token endpoints, register an OAuth app, push client credentials with `ntn workers env push` before deploying, then set the redirect URL from `ntn workers oauth show-redirect-url` and run `ntn workers oauth start <key>`.

Why does OAuth fail with redirect_uri_mismatch?▼

The redirect URL configured at the provider does not exactly match the worker's URL. Run `ntn workers oauth show-redirect-url` and paste that exact value into the provider's redirect URI setting before starting the OAuth flow.

Can I test OAuth locally with ntn workers exec --local?▼

Yes, but only after deploying once and completing the OAuth flow remotely. Then run `ntn workers env pull` to bring the access token into local `.env`; repeat the pull when the local token expires.

What if a service offers neither API keys nor OAuth?▼

Consider indirect paths: OAuth into a related service that holds the data, manual export/upload of CSV or JSON files, parsing the service's emails via Gmail OAuth, or cautiously using internal frontend endpoints after confirming terms-of-service compliance.