Skip to content
🎶 A Simple Linkfire wrapper
Branch: master
Clone or download
Latest commit 9ad169e Mar 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
index.js
package.json
yarn.lock

README.md

linkfire

A simple Node wrapper for Linkfire. Documentation available here.

Installation

npm install --save linkfire
yarn add linkfire # if you're hip
var link = new Linkfire({ id: keys.id, 'secret': keys.secret })

link.get('settings/boards')
    .then((boards) => boards[0].id)
    .then((board) => {
        var url = `campaigns/boards/${board}/links`;
        var options = {
            baseUrl: 'https://itunes.apple.com/ca/album/medication/id853190241?i=853190286',
            mediaType: 'Music',
            title: 'Medication'
        }

        link.post(url, options)
            .then((song) => {
                console.log(song.url)
            })
    })
    .catch((err) => console.error(err))

Documentation

All instance methods are resolvable promises.

new Linkfire(keys)

Represents the Linkfire class constructor

Param Type Description
keys object Object containing id and secret

linkfire.get(path, options)

Authenticates and makes a get request to the provided path

Kind: instance method of Linkfire

Param Type Description
path string The requested endpoint
options object Additional optional query parameters
link.get('settings/boards')
    .then((boards) => {
        console.log(boards);
    })

linkfire.post(path, options)

Authenticates and makes a post request to the provided path

Kind: instance method of Linkfire

Param Type Description
path string The requested endpoint
options object Additional optional query parameters
var board = '2e388c9b-5cfc-4782-addc-012920f91351';
var url = `campaigns/boards/${board}/links`;
var options = {
    baseUrl: 'https://open.spotify.com/track/23EfDk0wWDyIAbeefgni89',
    mediaType: 'Music',
    title: 'Awful Sound'
}

link.post(url, options)
    .then((song) => {
        console.log(song);
    })

Contribution

Thanks for contributing!

To make a contribution, fork the repo, add your changes, and submit a pull request. Any type of contributions (ideas, bug fixes, fixing typos, etc.) will be appreciated!

Make sure to test before you submit for a pull request.

git clone https://github.com/trmml/linkfire && cd linkfire
yarn install # installs dependencies
echo "{ "id": "public key", "secret": "secret key" }" > keys.json
yarn run test

License

LICENSE.

Linkfire's licensing is referenced here.

You can’t perform that action at this time.