A citation exporter must preserve the publication's real identity and review status. NexisHub already implements JSON, BibTeX and APA-style output, but the current code has format-specific limitations that should be tested rather than concealed.

This guide is part of the NexisHub Developer Tutorials desk. It connects practical engineering, research, and product decisions to the wider NexisHub platform.

The operating idea

The actual source contains `src/lib/nri-publication-registry.ts` and `src/app/research/publications/[slug]/citation/route.ts`. The registry currently records the AI Visibility Index working paper version 0.1 as Pre-Review, with `doi: null`, no validated organization rankings and no pilot data.

The citation route looks up a known slug, returns 404 if the record is absent and accepts a `format` query parameter. Default is JSON; `bibtex` produces downloadable BibTeX; `apa` produces an APA-style plain-text citation. These behaviors were verified in source, not certified against citation standards.

Editorial boundary

NexisHub separates verified platform documentation, repeatable observation, and inference. No optimization can guarantee selection or citation by an external system.

One publication record supplies every export

The NexisHub record contains slug, title, subtitle, document type, version, publication date, author names, canonical path, review level, DOI, licence and data availability. These fields define what an export is allowed to claim. A missing DOI must remain missing, and the label Pre-Review must not be silently upgraded to a peer-reviewed publication.

For an unknown slug, the route explicitly returns HTTP 404 with `Publication not found`. JSON returns the full record using `Content-Disposition` with a `.json` filename; the other two branches set their respective content types and download filenames. This consistency of source is useful even before additional citation formats are implemented.

A real BibTeX formatting weakness

In the inspected handler, the author list is built with `publication.authors.join(', ')`, then inserted into the BibTeX `author` field. Bibliography processors normally expect appropriately separated author names, so the output deserves parser-based tests rather than an assertion of perfect interoperability.

The entry key is constructed from the publication slug and version with one dot removed. Metadata is interpolated into braces without comprehensive escaping. Test multiple authors, Unicode, braces, backslashes, punctuation and version strings before relying on it in a production research workflow. Do not treat a visible downloaded file as proof that citation software can parse its meaning correctly.

The APA-style string is not an official formatter

The handler assembles an author string, year, title, version, document type, institution and canonical URL. This provides a convenient citation starting point. It does not implement every APA style requirement for surname initials, italics, capitalization or author-count rules, so users should see it as APA-style output pending formal format validation.

The source currently hardcodes the canonical `https://www.thenexishub.org` hostname. That is the reviewed site address, but exporters should eventually draw the public canonical host from a controlled configuration, not from a Preview deployment URL. A durable citation must keep the intended version identifiable even when the website or framework changes.

A test plan that could be automated today

Use fixture publications to test a known slug and an unknown slug; default JSON, explicit BibTeX, explicit APA-style text, and unexpected format values; exact content type and Content-Disposition headers; correct original author order and publication year; non-ASCII names; and a version without a DOI.

The route currently falls back to JSON when `format` is an unrecognized string. Whether to preserve or reject that behavior is an API design decision to document before clients depend on it. Retain the original response in contract tests and make breaking changes through an explicit versioned plan.

Core principles

  1. Never invent identifiersDo not create DOIs or peer-review claims when the publication record does not support them.
  2. One authoritative metadata recordExport and visible paper must agree on authors, status, version and URL.
  3. Test actual citation syntaxDownload success and valid bibliographic meaning are separate acceptance criteria.

A practical implementation workflow

Apply the work in a controlled sequence. Keep a baseline, name an owner, and define the evidence that will show whether each step was completed.

  1. 1. Validate the registryCheck title, authors, date, version and publication review status.
  2. 2. Implement supported formatsSerialize JSON, BibTeX and APA-style text from the same record.
  3. 3. Test unknown and malformed inputsConfirm intentional status codes and safe download headers.
  4. 4. Exercise citation parsersCheck author separation and special-character escaping with fixtures.

Common mistakes

Inventing a DOI

The AI Visibility Index registry explicitly has no DOI.

Assuming APA compliance

The current branch creates a plain-text APA-style approximation.

Ignoring immutable versions

A cited working paper should remain identifiable after updates.

How to measure it responsibly

Record format parsing success, invalid-input status, metadata parity and version-specific export correctness.

Review the endpoint's actual HTTP behavior before claiming a live citation download is functional.

Evidence rule

Keep observed outputs, diagnostic scores, inferred causes, and business outcomes in separate fields. A modelled score is not a citation, and correlation is not proof of cause.

What comes next

Add structured CSL exports, tested bibliographic formatting and stable versioned snapshots only after current contracts are measured.

The durable response is to build pages that are accessible, semantically explicit, useful outside their original layout, and backed by evidence a reader can inspect.

Key takeaways

01The repository already contains a real citation route.

02Its AI Visibility Index paper is pre-review, with DOI absent.

03The current BibTeX and APA formats require detailed validation.

04Never advertise unsupported academic status.

Frequently asked questions

Does NexisHub's paper have a DOI?

No. The inspected version 0.1 record explicitly sets DOI to null.

Are the current APA exports certified?

No. The route creates an APA-style string rather than a complete formal style engine.

References and further reading

  1. NexisHub AI Visibility Index working paper
  2. Crossref DOI guidelines
  3. BibTeX documentation
Nexis Studio

Turn a useful idea into a maintainable product.

Nexis Studio helps organisations move from problem definition to product design, engineering, launch, and long-term support with clear technical and commercial boundaries.

Explore Nexis Studio

Continue the cluster

Related NexisHub guides

Developer TutorialsBuilding a Structured Blog with Next.js and TypeScriptDeveloper TutorialsAdding JSON-LD Metadata to a Next.js WebsiteDeveloper TutorialsCreating a Secure Contact Form with Server-Side Validation