0.2.6 • Published 5 years ago

ripple.fm v0.2.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

ripple.fm

npm.io

Javascript client for the ripple.fm REST API. Supports using existing access tokens and will request a refresh if the current access token expires. The token storage method is up to the application.

Installation

yarn add ripple.fm

or

npm install --save ripple.fm

Configuration

To begin using the API client we must configure and create an instance.

Simple Example

import api from 'ripple.fm';

function myRefreshFunction() {
  // refresh access token here
}

const ripple = api.create({
  access: "some-token", // optional access token
  baseURL: "https://api.ripple.fm", // ripple.fm core api base url
  authURL: "https://accounts.ripple.fm", // accounts api base url
  onAccessTokenExpire: myRefreshFunction // access tokens are short lived and need to be refreshed
});

// begin using api
async function() {
  const stations = await ripple.getStations();
}

onAccessTokenExpire Implementation Example

An example of the configuration and refreshing access tokens in production is available here.

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago