VYBE Music Kit 1.0
Music for videos, reels and stories
The VYBE music library inside your app. Users search songs, hear the best part, pick any part or the whole song and post it under their video, the way TikTok sounds work, with the credit line ready to show.
The VYBE music library inside your app, for videos, reels and stories, like the music button in Instagram or Snapchat. Your users search songs, hear the best part, pick the part they want (15 s, 30 s, 60 s, any length, or the whole song) and the kit hands your app an audio file to put under their video (any part, or the whole song, the way TikTok sounds work), with the credit line to show on the post.
No player needed and no music files to host: VYBE serves everything. Artists choose to share their songs with partner apps, and the songs are free to use in your app under the Library Partner Terms.
Designed, Programmed and Developed by Arian Romal.
What is in the kit
| File | What it is |
|---|---|
vybe-music.ts |
The client: search, songs, clips, usage. No dependencies. React Native, Expo, web, Node, Deno, Workers. |
dist/vybe-music.js |
The same client as plain JavaScript (ES module), also at https://vybemusic.com/sdk/music/1.0.0/vybe-music.js |
react-native/MusicPicker.tsx |
A ready picker screen for React Native and Expo: search, VYBE chips, previews, trimmer, whole song, "Use this song" |
server/vybe-session.mjs |
The one route your server needs: makes a short-lived token for a signed-in user |
examples/expo-screen.tsx |
A full "Add music" screen |
examples/mix-into-video.md |
Putting the clip under the video on iOS, Android and with ffmpeg |
1. Keys
VYBE gives your app two keys (VYBE Office, Library tab):
- Secret key (
vybe_pk_...): only on your server, in an environment variable such asVYBE_SECRET_KEY. Never in the app. - Publishable key (
vybe_pub_..., optional): works only from the app ids and websites listed on it. Use it if your app has no server.
Recommended: your server turns the secret key into a one-hour token per user (server/vybe-session.mjs), and the app uses that.
2. Add the client
import { createVybeMusic } from './vybe-music';
const vybe = createVybeMusic({
token: () => fetch('https://api.yourapp.com/vybe-token', { headers: { Authorization: 'Bearer ' + session } }).then(r => r.json()),
});
// or, without a server: createVybeMusic({ key: 'vybe_pub_...', app: 'com.yourapp.ios' })
3. Show the picker (React Native or Expo)
import MusicPicker from './react-native/MusicPicker';
<MusicPicker vybe={vybe} onClose={close} onPick={({ clip, file }) => {
editor.setMusic(file); // a local .aac file of exactly the part the user picked
editor.setMusicLabel(clip.label); // "Title · Artist": show it on the post
}} />
The picker needs expo-audio and expo-file-system (both in every Expo template). Colours, title and lengths are props.
4. Or build your own screens
const { data, next_cursor } = await vybe.search({ q: 'summer', vybe: 'hype', limit: 30 });
// each song: id, title, display_artist, cover, duration, bpm, key, energy, vybes, waveform, ai_label, highlight {start, length}
const song = await vybe.track(data[0].id);
// + clip_suggestions: [{ label: 'Highlight' | 'Drop' | 'Hook' | 'Chorus' | 'Start', start, length }], lyrics, credits
const clip = await vybe.clip(song.id, { start: song.clip_suggestions[0].start, length: 15 });
// clip.url: a 6 hour link to the .aac file; clip.label / clip.attribution / clip.link for the post
const whole = await vybe.clip(song.id, { full: true }); // the whole song, for longer videos
Previews: play clip.url with any audio player (a 15 second clip of the highlight is perfect for the list).
Sounds, like TikTok
Every post that uses a VYBE song carries the song's id. Use it in your app the way TikTok uses sounds: a page for the
song with all posts that use it, a "Use this sound" button that opens the picker on the same song (vybe.track(id)),
and trending sounds from your own post counts. The song's cover, title, artist and link come from the API.
5. When the user posts
vybe.posted(song.id); // counts the use for the artist (no personal data: user ids are stored as a one-way hash)
Show clip.label and "VYBE" on the post (a music line under the user name, like other apps do), with clip.link
where you can. If the user saves or shares the finished video outside your app, the credit must be visible in the video.
Rules in short
- Any part of a song, or the whole song, under the user's own video. Trim, fade, volume and speed for the edit are fine; nothing else.
- No audio on its own: no download or share of the clip without the video, no ringtones, no audio-only posts.
- Show the credit on every post. Show
ai_label("Made with AI", "AI assisted") when a song has one. - If VYBE asks (a song taken down for a legal claim), mute or remove the posts with it within 3 business days.
- Full terms: https://vybemusic.com/legal/library/ (section 2A)
REST reference (any language)
Base https://vybemusic.com/api/library, header x-vybe-key: <token or key>.
| Call | |
|---|---|
GET /v1/vybes |
The ten VYBEs |
GET /v1/tracks?q=&vybe=&artist=&genre=&bpm_min=&bpm_max=&energy_min=&energy_max=&explicit=&limit=&cursor= |
Search and browse |
GET /v1/tracks/:id |
One song with clip_suggestions, lyrics and credits |
POST /v1/tracks/:id/clip {start?, length?, full?, user?} |
A part (5 s up to the whole song, default the 30 s highlight) or full: true for the whole song, as audio/aac |
POST /v1/usage {events:[{track_id, event, user?}]} |
preview, select, post and more |
POST /v1/sessions {user, hours} |
Secret key only: a token for one of your users |
Errors look like { "error": { "code": "rate_limited", "message": "..." } }. Limits: 120 requests a minute per user.
Questions: [email protected]