Skip to content
← Public packages

@kentcdodds/audible

Personal Audible library app — browser re-auth, library, wishlist, NAS archive stub.

src/index.ts

68 lines · 2.4 KB · TypeScript
import { AUDIBLE_AUTH_SECRET, audibleAuthSetupUrl } from './auth.ts'
import { AUTH_RELATED_HOSTS } from './locales.ts'

/**
 * Overview of `@kentcdodds/audible`: personal Audible library archive helpers + app.
 * Call this to discover exports, auth storage notes, and setup URL — then use
 * the package app or `./start-auth` / `./complete-auth` for browser re-auth.
 *
 * @returns Package capabilities and setup links (no secret values)
 *
 * @example
 * import overview from 'kody:@kentcdodds/audible'
 *
 * const info = await overview()
 */
export default async function overview() {
	return {
		name: '@kentcdodds/audible',
		category: 'integrations',
		purpose:
			'Personal archive of owned Audible titles: browser OpenID+PKCE re-auth, library, wishlist, Adrm AAXC license, and Save-to-NAS via home MCP convert tools.',
		auth: {
			secretName: AUDIBLE_AUTH_SECRET,
			storageKey: 'audible-auth-v1',
			setupUrl: audibleAuthSetupUrl(),
			shape:
				'audible-cli auth JSON from browser device registration stored in packageStorage for ADP signing (opaque audibleAuth mount is optional / not re-read)',
			hostsToApprove: AUTH_RELATED_HOSTS,
			browserFlow: {
				start: './start-auth',
				complete: './complete-auth',
				app: 'Open package app → Connect → Amazon login → paste maplanding URL',
			},
		},
		exports: [
			'.',
			'./client',
			'./library',
			'./library-item',
			'./wishlist',
			'./auth-status',
			'./start-auth',
			'./complete-auth',
			'./download-license',
			'./archive-to-nas',
			'./library-archive-status',
			'./archive-remaining',
		],
		app: {
			entry: './src/app.ts',
			tabs: ['Connect', 'Library', 'Wishlist', 'Archive'],
		},
		scope: {
			ownedTitlesOnly: true,
			noDrmRedistribution: true,
			archiveToNas: 'wired — Audible license here, home MCP converts AAXC to Title.m4b on the NAS',
		},
		nextSteps: [
			'Open the hosted package app Connect tab (or call start-auth).',
			'Sign in on Amazon; paste the maplanding URL into complete-auth / the app form.',
			'Call auth-status then browse Library / Wishlist in the app.',
			'Library marks On NAS via ./library-archive-status (home exists on Title.m4b). Archive → Save to NAS (or ./archive-to-nas) requests an Adrm license and calls home.audiobook_import_aaxc. Conversion stays on home.',
		],
	}
}

export { fromAuthFile, createClient, signRequest } from './client.ts'
export { AUDIBLE_AUTH_SECRET, audibleAuthSetupUrl } from './auth.ts'