@bradgarropy/captivate-sdk
Version:
š¤ captivate sdk
251 lines (173 loc) ⢠7.85 kB
Markdown
[![version][version-badge]][npm]
[![downloads][downloads-badge]][npm]
[![size][size-badge]][bundlephobia]
[![github actions][github-actions-badge]][github-actions]
[![coverage][codecov-badge]][codecov]
[![typescript][typescript-badge]][typescript]
[![contributing][contributing-badge]][contributing]
[![contributors][contributors-badge]][contributors]
[![discord][discord-badge]][discord]
_[Captivate][captivate] JavaScript SDK for retrieving podcast information._
<p align="center">
<a href="https://www.npmjs.com/package/@bradgarropy/next-seo">
<img alt="next link" src="./images/github.png" width="500">
</a>
</p>
This package is hosted on [npm][npm].
```bash
npm install @bradgarropy/captivate-sdk
```
Start off by creating a `Captivate` client, then authenticate to the [Captivate API][captivate-api]. Now you can use the client to retrieve your podcast shows and episodes.
```javascript
const captivate = new Captivate("abc123", "123456789")
const show = await captivate.shows.getShow("abc123")
const episode = await captivate.episodes.getEpisode("xyz123")
```
| Name | Type | Example | Description |
| -------- | -------- | ------------- | ------------------ |
| `userId` | `string` | `"abc123"` | Captivate user id. |
| `apiKey` | `string` | `"123456789"` | Captivate api key. |
Create a `Captivate` client.
```javascript
const captivate = new Captivate("abc123", "123456789")
```
Authenticate a user to the [Captivate API][captivate-api].
```javascript
captivate.authentication.authenticateUser()
```
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ----------- |
| `userId` | `string` | `"abc123"` | User id. |
Get a user.
```javascript
captivate.users.getUser("abc123")
```
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ----------- |
| `userId` | `string` | `"abc123"` | User id. |
Get a list of podcasts that a user belongs to.
```javascript
captivate.users.getUsersShows("abc123")
```
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ----------- |
| `userId` | `string` | `"abc123"` | User id. |
Get a list of podcasts that a user manages.
```javascript
captivate.users.getUsersManagedShows("abc123")
```
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ---------------- |
| `showId` | `string` | `"abc123"` | Podcast show id. |
Get a podcast.
```javascript
captivate.shows.getShow("abc123")
```
_// TODO_
_// TODO_
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ---------------- |
| `showId` | `string` | `"abc123"` | Podcast show id. |
Get all episodes from a podcast.
```javascript
captivate.shows.getShowEpisodes("abc123")
```
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ---------------- |
| `showId` | `string` | `"abc123"` | Podcast show id. |
Get all scheduled episodes from a podcast.
```javascript
captivate.shows.getShowScheduledEpisodes("abc123")
```
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ---------------- |
| `showId` | `string` | `"abc123"` | Podcast show id. |
Get the RSS feed URL for a podcast.
```javascript
captivate.shows.getShowFeedUrl("abc123")
```
| Name | Type | Example | Description |
| --------- | -------- | ---------- | ----------- |
| `mediaId` | `string` | `"abc123"` | Media id. |
Get an item from your media library.
```javascript
captivate.media.getMedia("abc123")
```
_// TODO_
| Name | Type | Example | Description |
| -------- | -------- | ---------- | ---------------- |
| `showId` | `string` | `"abc123"` | Podcast show id. |
Get all media from a podcast.
```javascript
captivate.media.getShowMedia("abc123")
```
_// TODO_
| Name | Type | Example | Description |
| ----------- | -------- | ---------- | ------------------- |
| `episodeId` | `string` | `"xyz123"` | Podcast episode id. |
Get a podcast episode.
```javascript
captivate.episodes.getEpisode("xyz123")
```
_// TODO_
_// TODO_
š report bugs by filing [issues][issues]
š¢ provide feedback with [issues][issues] or on [twitter][twitter]
šš¼āāļø use my [ama][ama] or [twitter][twitter] to ask any other questions
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://bradgarropy.com"><img src="https://avatars.githubusercontent.com/u/11336745?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brad Garropy</b></sub></a><br /><a href="https://github.com/bradgarropy/captivate-sdk/commits?author=bradgarropy" title="Code">š»</a> <a href="https://github.com/bradgarropy/captivate-sdk/commits?author=bradgarropy" title="Documentation">š</a> <a href="https://github.com/bradgarropy/captivate-sdk/commits?author=bradgarropy" title="Tests">ā ļø</a> <a href="#infra-bradgarropy" title="Infrastructure (Hosting, Build-Tools, etc)">š</a></td>
</tr>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
[]: https://app.codecov.io/gh/bradgarropy/captivate-sdk
[]: https://github.com/bradgarropy/captivate-sdk/blob/master/contributing.md
[]:
[]: https://www.npmjs.com/package/@bradgarropy/captivate-sdk
[]: https://img.shields.io/codecov/c/github/bradgarropy/captivate-sdk?style=flat-square
[]: https://img.shields.io/npm/v/@bradgarropy/captivate-sdk.svg?style=flat-square
[]: https://img.shields.io/npm/dt/@bradgarropy/captivate-sdk?style=flat-square
[]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square
[]: https://img.shields.io/github/all-contributors/bradgarropy/captivate-sdk?style=flat-square
[]: https://github.com/bradgarropy/captivate-sdk/issues
[]: https://twitter.com/bradgarropy
[]: https://bradgarropy.com/ama
[]: https://bundlephobia.com/result?p=@bradgarropy/captivate-sdk
[]: https://img.shields.io/bundlephobia/minzip/@bradgarropy/captivate-sdk?style=flat-square
[]: https://github.com/bradgarropy/captivate-sdk/actions
[]: https://img.shields.io/github/workflow/status/bradgarropy/captivate-sdk/%F0%9F%9A%80%20release?style=flat-square
[]: https://www.typescriptlang.org/dt/search?search=%40bradgarropy%2Fcaptivate-sdk
[]: https://img.shields.io/npm/types/@bradgarropy/captivate-sdk?style=flat-square
[]: https://bradgarropy.com/discord
[]: https://img.shields.io/discord/748196643140010015?style=flat-square
[]: https://captivate.fm
[]: https://api.captivate.fm