@totalaudiopromo/newsjack-sdk
v0.1.1
Published
TypeScript SDK for the NewsJack API — real-time music industry newsjacking, scoring, custom-voice post drafting, and editorial roasts.
Maintainers
Readme
@totalaudiopromo/newsjack-sdk
TypeScript SDK for the NewsJack real-time music industry newsjacking API.
Installation
npm install @totalaudiopromo/newsjack-sdk
# or
pnpm add @totalaudiopromo/newsjack-sdk
# or
bun add @totalaudiopromo/newsjack-sdkQuick Start
import { NewsjackClient } from '@totalaudiopromo/newsjack-sdk'
// Authenticate via environment variable NEWSJACK_API_KEY or direct parameter
const client = new NewsjackClient({
apiKey: process.env.NEWSJACK_API_KEY, // nj_ak_*
})
// 1. Fetch top scored stories
const { stories } = await client.stories.list({
minRelevance: 0.6,
limit: 5,
})
// 2. Draft a tailored social post in brand voice
if (stories.length > 0) {
const post = await client.generate.post({
storyId: stories[0].id,
platform: 'linkedin',
controls: {
conviction: 'spicy',
pov: 'insider',
},
})
console.log(post.content)
}
// 3. Roast an existing draft against 72h trending cycles
const critique = await client.roast.critique({
draftText: "Excited to announce our new single dropping this Friday!",
platform: 'twitter',
})
console.log(critique.headlineVerdict, critique.actionableFixes)Capabilities
client.stories: List, search, filter, and retrieve scored music industry news items.client.generate: Generate high-relevance posts (X, LinkedIn, Newsletter) in custom or house voice with anti-slop checks.client.roast: Brutal editorial critique against recent news cycles with actionable rewrite suggestions.client.voiceProfiles: Create and manage custom voice profiles and tone constraints.client.briefings: Access daily automated morning digests.client.engine: Trigger real-time RSS/web scans and query community signals (Reddit, HN, GitHub).client.health: Monitor service and AI provider failover status.
Error Handling
All failed API requests reject with a structured NewsjackApiError:
import { NewsjackApiError } from '@totalaudiopromo/newsjack-sdk'
try {
await client.generate.post({ storyId: '...', platform: 'twitter' })
} catch (err) {
if (err instanceof NewsjackApiError) {
console.error(`Error (${err.status}): ${err.code} - ${err.message}`)
if (err.isRetryable) {
console.log('Provider rate-limited or failover in progress. Retry recommended.')
}
}
}License
MIT © Total Audio Promo / Chris Schofield
