npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@javagt/tvnz-plus-api

v1.0.0

Published

TypeScript client for the TVNZ Plus streaming API. Ported by DeepSeek V4 Flash.

Readme

@javagt/tvnz-plus-api

Version 1.0.0 — TypeScript client for the TVNZ Plus streaming API.

Reverse-engineered from HAR captures of the official TVNZ Plus web application. Ported by DeepSeek V4 Flash.

Installation

npm install @javagt/tvnz-plus-api

Library Usage

Quick start with existing session

import { TvnzClient } from '@javagt/tvnz-plus-api';

const client = new TvnzClient();

// Load existing session from ozistream/ozivine local_storage.json
client.loadSession('/path/to/local_storage.json');

// Or inject tokens directly
client.setSession({
  accessToken: 'eyJ...',
  refreshToken: 'DASj...',
  deviceref: '51ff1fd0-...',
});

// Get series details
const series = await client.series.getBySlug('shortland-street');
console.log(series?.displayInfo.title);

// Get seasons and episodes
const seasons = await client.series.getSeasons(series!.id);
const episodes = await client.series.getEpisodes(series!.id, seasons[0].id);

Full auth flow (no session needed)

import { TvnzClient } from '@javagt/tvnz-plus-api';

const client = new TvnzClient();
await client.authenticate();  // OAuth2 → platform JWT → device registration

// Authorize video playback
const auth = await client.playback.authorize('shortland-street-81');
console.log('MPD:', auth?.mpdUrl);
console.log('License:', auth?.licenseUrl);

Browse catalog

import { TvnzClient } from '@javagt/tvnz-plus-api';

const client = new TvnzClient();
client.loadSession('/path/to/local_storage.json');

// Homepage carousels
const homepage = await client.catalog.getHomepage();

// Continue watching
const watching = await client.catalog.getContinueWatching(userId, profileId);

// Recommendations
const recommended = await client.catalog.getRecommended(userId, profileId);

Account management (Evergent API)

import { TvnzClient } from '@javagt/tvnz-plus-api';

const client = new TvnzClient();

// Browse subscription products
const products = await client.account.getProducts();

// Send OTP for login
await client.account.createOtp('[email protected]', 'recaptcha-token');

// Confirm OTP and get JWT
const result = await client.account.confirmOtp('[email protected]', '123456');

// Get entitlements
const entitlements = await client.account.getEntitlements(result!.contactId);

ESM Imports

import { TvnzClient } from '@javagt/tvnz-plus-api';
import { TvnzAuth } from '@javagt/tvnz-plus-api';
import { CatalogApi, SeriesApi, PlaybackApi, AccountApi } from '@javagt/tvnz-plus-api';
import type { TvnzSession, Series, Episode, AuthorizeResponse } from '@javagt/tvnz-plus-api';

API

TvnzClient

| Method | Description | |--------|-------------| | new TvnzClient(deviceId?) | Create client with optional device UUID | | loadSession(path) | Load existing session from local_storage.json (ozistream/ozivine format) | | setSession(session) | Inject session tokens directly | | authenticate() | Full OAuth2 → platform JWT → device registration flow |

.catalogCatalogApi

| Method | Description | |--------|-------------| | getHomepage() | Homepage carousels and recommendations | | getContinueWatching(userId, profileId) | Continue-watching feed | | getRecommended(userId, profileId) | Recommended content | | getMoreLikeThis(seriesId) | "More Like This" recommendations | | getLaunchConfig() | App launch configuration |

.seriesSeriesApi

| Method | Description | |--------|-------------| | getBySlug(slug) | Series details by URL slug | | getSeasons(seriesId) | Seasons for a series | | getEpisodes(seriesId, seasonId) | Episodes for a season | | getEpisode(slug) | Episode details by URL slug | | getUpNext(seriesId, seasonNum, epNum) | "Up Next" recommendation | | search(query) | Search catalog |

.playbackPlaybackApi

| Method | Description | |--------|-------------| | authorize(slug) | Authorize content playback, returns MPD + license URLs | | getBookmark(contentId) | Get resume point for an episode | | saveBookmark(itemId, offset, seasonId, episodeId) | Save resume point | | createStream() | Create streaming session | | deleteStream() | Delete streaming session |

.accountAccountApi

| Method | Description | |--------|-------------| | getProducts() | Available subscription plans | | searchAccount(email) | Look up account by email | | createOtp(email, captchaToken) | Send OTP email | | confirmOtp(email, otp) | Verify OTP, return JWT + contactId | | getContact(contactId?) | Get user profile | | getEntitlements(contactId) | Get subscriptions/entitlements | | getFavorites() | List favorited content | | isFavorited(contentId) | Check if content is favorited |

Session Compatibility

This library uses the same session format as ozistream, ozivine (@javagt/ozivine), and other TVNZ download tools. The session file (local_storage.json) contains:

{
  "accessToken": "eyJ...",
  "refreshToken": "DASj...",
  "deviceref": "51ff1fd0-..."
}

To use an existing session export:

import { TvnzClient } from '@javagt/tvnz-plus-api';

const client = new TvnzClient();
client.loadSession('/path/to/local_storage.json');
await client.authenticate();  // auto-refreshes if needed

Or inject tokens programmatically:

client.setSession({
  accessToken: 'eyJ...',
  refreshToken: 'DASj...',
  deviceref: '51ff1fd0-...',
});

License

MIT

Ported from TVNZ Plus web app HAR captures by DeepSeek V4 Flash.