
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.
udio-wrapper
Advanced tools
A Framework-agnostic TypeScript wrapper for interacting with the Udio API to generate music. This library is inspired by UdioWrapper.
npm install udio-wrapper
import { createUdioWrapper } from 'udio-wrapper';
async function generateMusic() {
// Create a client instance with your auth token
const client = await createUdioWrapper('your-auth-token-here');
// Create a song
const song = await client.createSong({
prompt: 'Relaxing jazz and soulful music',
seed: 12345, // Optional field for reproducible results
customLyrics: 'Custom lyrics for your song', // Optional field
});
console.log('Song created:', song);
// Wait for the song to be ready
const completedSong = await client.waitForCompletion(song.id);
console.log('Song is ready:', completedSong);
}
generateMusic();
import { createUdioWrapper } from 'udio-wrapper/browser';
const client = createUdioWrapper('your-auth-token-here');
import { createUdioWrapper } from 'udio-wrapper/node';
const client = await createUdioWrapper('your-auth-token-here');
import React, { useEffect, useState } from 'react';
import { createUdioWrapper, useUdio, UdioWrapper } from 'udio-wrapper/browser';
function MusicGenerator() {
const [client, setClient] = useState(null);
useEffect(() => {
// Initialize the client once when the component mounts
const client = createUdioWrapper('your-auth-token-here');
setClient(client);
}, []);
const { createSong, isLoading } = useUdio(client, { autoPolling: true });
const handleCreateSong = async () => {
const song = await createSong({
prompt: 'Upbeat electronic music with synth melody',
});
console.log('Song created and ready:', song);
};
if (!client) return <div>Initializing...</div>;
return (
<div>
<h1>Udio Music Generator</h1>
<button
onClick={handleCreateSong}
disabled={isLoading}
>
{isLoading ? 'Generating...' : 'Create Song'}
</button>
</div>
);
}
export default MusicGenerator;
// pages/api/create-song.ts
import type { NextApiRequest, NextApiResponse } from 'next';
import { createUdioWrapper } from 'udio-wrapper/node';
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
if (req.method !== 'POST') {
return res.status(405).json({ error: 'Method not allowed' });
}
const { prompt, customLyrics, seed } = req.body;
const authToken = process.env.UDIO_AUTH_TOKEN;
const client = await createUdioWrapper(authToken);
const result = await client.createSong({ prompt, customLyrics, seed });
return res.status(200).json(result);
}
// pages/index.tsx
import { useState } from 'react';
import type { NextPage } from 'next';
import { UdioResponse } from 'udio-wrapper';
const Home: NextPage = () => {
const [prompt, setPrompt] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [song, setSong] = useState(null);
const handleSubmit = async (e) => {
e.preventDefault();
setIsLoading(true);
const response = await fetch('/api/create-song', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ prompt }),
});
const data = await response.json();
setSong(data);
setIsLoading(false);
};
return (
<div className="container">
<h1>Udio Music Generator</h1>
<form onSubmit={handleSubmit}>
<div>
<label htmlFor="prompt">Music Description:</label>
<textarea
id="prompt"
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
placeholder="Describe the music you want to generate..."
rows={4}
required
/>
</div>
<button type="submit" disabled={isLoading || !prompt}>
{isLoading ? 'Generating...' : 'Create Song'}
</button>
</form>
{song && (
<div className="result">
<h2>Generated Song</h2>
<p>Status: {song.status}</p>
{song.status === 'completed' && (
<>
<audio controls src={song.url} />
<p>
<a href={song.url} target="_blank" rel="noopener noreferrer">
Download Song
</a>
</p>
</>
)}
</div>
)}
</div>
);
};
export default Home;
const song = await client.createSong({
prompt: 'Relaxing jazz with piano and saxophone',
seed: 12345,
customLyrics: 'The moonlight dances on the water...'
});
const extended = await client.extendSong({
prompt: 'A more energetic variation with drums',
audioConditioningPath: 'https://api.udio.com/songs/original.mp3',
audioConditioningSongId: 'song_123456',
customLyrics: 'The rhythm picks up as the night unfolds...'
});
const outro = await client.addOutro({
prompt: 'A gentle, fading conclusion',
audioConditioningPath: 'https://api.udio.com/songs/extended.mp3',
audioConditioningSongId: 'song_789012',
customLyrics: 'As the melody fades into silence...'
});
const sequence = await client.createCompleteSequence({
shortPrompt: 'A peaceful melody with acoustic guitar',
extendPrompts: [
'Add piano and soft percussion',
'Introduce string instruments'
],
outroPrompt: 'A gentle conclusion with fading instruments',
numExtensions: 2,
customLyricsShort: 'The journey begins...',
customLyricsExtend: [
'Moving forward with purpose...',
'Reaching new heights of emotion...'
],
customLyricsOutro: 'Until we meet again...'
});
const status = await client.getSongStatus('song_123456');
const completedSong = await client.waitForCompletion('song_123456', {
pollingInterval: 3000,
maxAttempts: 30,
onProgress: (status) => {
console.log(`Current status: ${status.status}`);
}
});
Thanks to everyone who has contributed to this project so far.
"Udio" and the Udio logo are trademarks or registered trademarks of Uncharted Labs, Inc. This project, "udio-wrapper", is an independent and unofficial solution developed by the community and is not affiliated with, sponsored by, or endorsed by Uncharted Labs, Inc.
The use of the Udio trademark and logo in this project is for referential purposes only, to indicate compatibility and interoperability with the Udio software. We acknowledge and respect the intellectual property rights of Uncharted Labs, Inc.
This project is an open-source, non-commercial initiative developed to enhance the user experience of Udio users. We do not claim any ownership rights to the Udio trademark or logo.
This project:
The Udio trademark and logo are used strictly within fair use guidelines and solely for:
We respect the rights of trademark holders and will promptly address any concerns regarding the use of trademarks or logos. If you are a representative of Uncharted Labs, Inc. and have concerns about the use of the trademark or logo in this project, please contact us immediately.
FAQs
A modern TypeScript wrapper for the Udio API for music generation
We found that udio-wrapper 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.