# extendify/3.2.1/src/Shared/lib/vibes.js

Extendify, version 3.2.1. 24 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Shared/lib/vibes.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.1/raw/src/Shared/lib/vibes.js
- Modified: 2026-08-27T17:39:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Shared/lib/vibes.js#L10-L20`.

```javascript
import { AI_HOST } from '@constants';

// The whole set is a third of a megabyte, so callers ask for what they show.
export const getVibes = async (query = '') => {
	const url = new URL(`${AI_HOST}/api/vibes`);
	if (query) url.searchParams.set('vibes', query);

	const response = await fetch(url, {
		method: 'GET',
		headers: { 'Content-Type': 'application/json' },
	});

	if (!response.ok) throw new Error('Bad response from server');

	const { vibes } = await response.json();
	return Array.isArray(vibes) ? vibes : [];
};

export const vibesBySlug = (vibes) =>
	Object.fromEntries((vibes ?? []).map((vibe) => [vibe.slug, vibe]));

export const vibeCssBySlug = (vibes) =>
	Object.fromEntries((vibes ?? []).map(({ slug, css }) => [slug, css ?? '']));

```
