Skip to content

Add JSDoc and README API reference #23

Description

@Just-Bamford

Summary

The @anonvote/crypto SDK has no documentation. Each function lacks JSDoc comments, there is no README with examples, and developers have no way to understand the API without reading source code. Complete documentation is required before publishing to npm.

This is a Milestone 3 requirement. Documentation is part of a professional SDK release.

Background

The crypto module exports five primitives but they are not documented. There is no README in the js/ folder. There are no code examples. New developers cannot discover the API or understand what each function does.

Scope

JSDoc Comments

  • Add JSDoc comments to all exported functions and classes:
  • Each comment should include:
    • Brief description
    • @param for each parameter with type and description
    • @returns with return type and description
    • @throws for any errors thrown
    • @example with a code snippet

README

  • Create js/README.md with:
    • Project description
    • Installation instructions
    • Quick start example
    • API reference (link to or embed JSDoc)
    • Contributing guidelines
    • License

Type Definitions

  • Ensure TypeScript types are exported and correct
  • No any types — all functions should be fully typed

Tests

  • Documentation builds without errors (if using typedoc)
  • Examples in JSDoc are syntactically correct
  • All functions mentioned in README have corresponding JSDoc

Relevant Files

  • js/src/crypto/index.ts
  • js/src/crypto/encrypt.ts
  • js/src/crypto/hash.ts
  • js/src/crypto/verify.ts
  • js/src/client/AnonVoteClient.ts
  • js/README.md (new)

Acceptance Criteria

  • All functions have JSDoc comments
  • README provides quick start and API reference
  • All TypeScript types are correct and exported
  • Examples in documentation are runnable

Out of Scope

  • Full API documentation site — README and JSDoc are sufficient
  • Internationalized documentation — English only
  • Video tutorials — written docs only

Note for Contributors

Use typedoc comments sparingly — keep examples short and focused. Link to the full AnonVote documentation for deeper context. Make sure examples match the actual function signatures.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions