
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
openplay-sdk
Advanced tools
Type-safe TypeScript SDK for the OpenPlay Music API.
npm install openplay-sdk
# or
pnpm add openplay-sdk
# or
yarn add openplay-sdk
import { createClient } from 'openplay-sdk'
const client = createClient({
apiKeyId: process.env.OPENPLAY_API_KEY_ID!,
apiSecretKey: process.env.OPENPLAY_API_SECRET_KEY!,
})
// Search releases
const releases = await client.releases.search({ q: 'album name' })
// Get a specific artist
const artist = await client.artists.get('artist-id')
// Auto-paginate through all artists
for await (const artist of client.artists.searchAll()) {
console.log(artist.name)
}
The SDK covers the following OpenPlay API resources:
You can use createClientFromEnv() which reads from these environment variables:
OPENPLAY_API_KEY_ID - Your API key IDOPENPLAY_API_SECRET_KEY - Your API secret keyOPENPLAY_BASE_URL (optional) - Custom API base URLimport { createClientFromEnv } from 'openplay-sdk'
const client = createClientFromEnv()
const page1 = await client.artists.search({ limit: 50 })
const page2 = await client.artists.search({ limit: 50, offset: 50 })
// Iterate through all results
for await (const artist of client.artists.searchAll()) {
console.log(artist.name)
}
// Collect all results into an array
import { collectAll } from 'openplay-sdk'
const allArtists = await collectAll(client.artists.searchAll())
The SDK provides typed errors for different failure scenarios:
import {
AuthenticationError,
NotFoundError,
RateLimitError,
ValidationError,
OpenPlayError,
} from 'openplay-sdk'
try {
await client.artists.get('invalid-id')
} catch (error) {
if (error instanceof NotFoundError) {
console.log('Artist not found')
} else if (error instanceof RateLimitError) {
console.log(`Rate limited, retry after ${error.retryAfter}s`)
} else if (error instanceof AuthenticationError) {
console.log('Invalid credentials')
}
}
Verify incoming webhook signatures:
import { verifyWebhookSignature } from 'openplay-sdk/webhooks'
const isValid = verifyWebhookSignature({
payload: requestBody,
signature: request.headers['x-openplay-signature'],
secret: process.env.OPENPLAY_WEBHOOK_SECRET!,
})
Submit bulk jobs and poll for completion:
import { submitAndWait } from 'openplay-sdk'
const result = await submitAndWait(
() => client.releases.bulkCreate(releases),
(jobId) => client.releases.getBulkStatus(jobId),
{ timeoutMs: 60000, pollIntervalMs: 2000 }
)
MIT
FAQs
Type-safe TypeScript SDK for the OpenPlay Music API
We found that openplay-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.