Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sdk.anghami.com/llms.txt

Use this file to discover all available pages before exploring further.

PlaylistService is read-only and exposes two operations:
RPCAuthWhat it does
GetPlaylistAPI key or OAuthFetch a playlist by PlaylistID, with paginated items.
GetUserPlaylistsOAuth (read scope)List the authenticated user’s playlists.

GetPlaylist

const res = await playlist.getPlaylist({
  id: "abc123",
  pageSize: 50,
});
Returns the playlist metadata (title, owner, artwork, item count) and a paginated batch of items. The items list is a slice of Content — playlists may contain songs, podcasts, or other supported entity kinds, so branch on the oneof id to render each row correctly. GetPlaylist works with both API keys and OAuth tokens. With an API key you can read public playlists; with an OAuth token you can additionally read playlists the authenticated user has access to.

GetUserPlaylists

const res = await playlist.getUserPlaylists({
  pageSize: 50,
});
Returns the authenticated user’s own playlists — created and saved. Requires the read OAuth scope.

Mutating playlists

The current SDK exposes read-only playlist operations. Creating, editing, reordering, or deleting playlists requires the user to operate inside the Anghami app or web client. A write-scoped mutation surface is reserved for a future revision.

Patterns

  • Mixed-content rendering. Use the Content.oneof id arm to dispatch to the right entity-fetch (e.g. GetSong) when you need full detail beyond the wrapper’s display fields.
  • Avoid N+1. When rendering a playlist of N songs and you need song-level data, fetch the playlist first, then use BatchGetSongs with the collected IDs — one call instead of N.
  • Pagination. Long playlists are deeply paginated. Render the first page eagerly and lazy-load on scroll.