> ## Documentation Index
> Fetch the complete documentation index at: https://docs.napps.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Collection service

`collectionService` fetches collection data for JavaScript extensions.

```ts theme={null}
collectionService.getCollectionsByIDs(
  ids: string[],
  metafields?: string[]
): Promise<Collection[]>;

collectionService.getCollectionsByID(
  id: string,
  metafields?: string[]
): Promise<Collection[]>;
```

```ts theme={null}
const collections = await collectionService.getCollectionsByIDs(
  ["gid://shopify/Collection/123"],
  ["custom.badge"]
);
```

See [Data models](/models) for the `Collection` shape.
