cursor-sdk auth.md: non-null assertion described as a runtime missing-variable check
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- documentation
Research direction
Open cursor-sdk/skills/cursor-sdk/references/auth.md at the referenced line and review the paragraph describing apiKey: process.env.CURSOR_API_KEY!. Compare it with the explicit missing-key check shown a few lines below. Update the explanation so it accurately distinguishes TypeScript's compile-time assertion from runtime validation, then verify the documentation no longer claims that ! checks the environment variable.
Written by the indexing model from the issue text.
Description
Observed at commit 2eb7ed4613cfc8f098dfe464a23680ea44d84c5e: cursor-sdk/skills/cursor-sdk/references/auth.md line 45.
The text reads:
The non-null assertion (
!) is a readable way to say "fail loudly if the env var is missing" — otherwise the SDK will throw an auth error later and the stack trace won't point at the env var.
for the example apiKey: process.env.CURSOR_API_KEY!.
Problem
In TypeScript the postfix ! is a compile-time-only assertion; it is erased in emitted JavaScript and performs no runtime check. If CURSOR_API_KEY is unset, undefined is passed through and the failure appears later in the SDK, exactly the outcome the sentence says ! avoids.
Suggested fix
Reword to say that ! only silences the type error and does no check, and lead with the explicit check that is already shown a few lines below:
const apiKey = process.env.CURSOR_API_KEY;
if (!apiKey) {
console.error("Missing CURSOR_API_KEY. ...");
process.exit(1);
}
- Dominant language
- TypeScript
- Stars
- 9.7k
- Forks
- 919
- Avg merge
- 18h 25m
- Merged PRs (30d)
- 74
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cursor/plugins
-
pstack: Comment Sicko agent name has a space and Grok rejects the spawnPossibly taken @lab1207 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cursor/plugins#483 · 2 comments ·
Maintainers usually reply within 1 day
-
create-plugin README documents a /create-plugin command that does not existPossibly taken @lab1207 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cursor/plugins#475 · 1 comment ·
Maintainers usually reply within 1 day
-
principle-test-behavior-not-implementation: listed matchers do not all pass when imports return undefinedPossibly taken @Yi-111-a claimed this 5 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
cursor/plugins#474 · 1 comment ·
Maintainers usually reply within 1 day
-
watch-pr: review threads are fetched without pagination (first 100 only)Possibly taken @Yi-111-a claimed this 4 days ago. Open
Difficulty 2/5 Half a day Newbie friendliness 84/100
cursor/plugins#471 · 1 comment ·
Maintainers usually reply within 1 day
-
check-agent-compatibility: SKILL.md description has an unquoted colon, YAML parse failsPossibly taken @rufushsu9987 claimed this 18 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
cursor/plugins#381 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 Under an hour Newbie friendliness 85/100
capricorn86/happy-dom#2474 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
JSerwatka/letterboxd-tweaks#81 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
siyuan-note/siyuan#20165 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
polkadot-js/phishing#5716 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
juice-shop/juice-shop#3662 ·
Maintainers usually reply within 1 day