Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

cursor-sdk auth.md: non-null assertion described as a runtime missing-variable check

Open Beginner friendly
#473 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@lab1207 is already working on this.

Since Oct 2, 2026.

  • #488 by @lab1207 — open

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cursor/plugins

All issues in cursor/plugins

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.