Référence SDK
Ondes.Social
Feed, posts, likes, stories et système follow/followers.
Smart Media
Les vidéos uploadées sont automatiquement converties en HLS pour un streaming adaptatif. Les images sont optimisées (max 1920×1920, JPEG 85%).getProfile(options?)
Récupère le profil d'un utilisateur. Sans paramètre, retourne le profil de l'utilisateur connecté.
JS
class=class="code-string">"code-comment">// Mon profil
const me = await Ondes.Social.getProfile();
class=class="code-string">"code-comment">// Profil dclass=class="code-string">"code-string">'un autre utilisateur
const user = await Ondes.Social.getProfile({ userId: 42 });
const user2 = await Ondes.Social.getProfile({ username: 'alice' });
class=class="code-string">"code-comment">// Retour: { id, username, avatar, bio, followers_count, following_count, is_following }getFeed(options?)
Récupère une liste de posts selon l'algorithme sélectionné.
| Paramètre | Type | Default | Description |
|---|---|---|---|
type | String | 'main' | 'main', 'discover', 'friends', 'video'. |
limit | Number | 50 | Nombre de posts à récupérer. |
offset | Number | 0 | Décalage pour la pagination. |
JS
class=class="code-string">"code-comment">// Feed principal (algorithme scoring)
const feed = await Ondes.Social.getFeed();
class=class="code-string">"code-comment">// Feed découverte (posts publics populaires)
const discover = await Ondes.Social.getFeed({ type: class=class="code-string">"code-string">'discover', limit: 30 });
class=class="code-string">"code-comment">// Feed vidéo class="code-string">"TikTok style"
const videos = await Ondes.Social.getFeed({ type: class=class="code-string">"code-string">'video', limit: 10 });getUserPosts(userId, options?)
JS
const posts = await Ondes.Social.getUserPosts(42, { limit: 20, offset: 0 });searchUsers(query)
JS
const users = await Ondes.Social.searchUsers(class=class="code-string">"code-string">'alice');
class=class="code-string">"code-comment">// [{ id, username, avatar, bio, followers_count, is_following }, ...]follow(userId) / unfollow(userId)
JS
await Ondes.Social.follow(42);
await Ondes.Social.unfollow(42);