Skip to content

onsen-ui/mstdn-api

Repository files navigation

mstdn-api

Build Status Coverage Status

UMD (including Node, Browser, and TypeScript!) Library for Mastodon API
Github repository, and npm package are available.

Why mstdn-api?

You can use this library universally: Node, Browser(ES5), and TypeScript.

How to install

$ npm i -S mstdn-api

How to use

There are simple examples in ./example.

if you can use import-syntax, then:

import Mastodon from 'mstdn-api'

const ACCESS_TOKEN = '......' // OAuth access_token (required)
const BASE_URL = 'mstdn.jp' // Mastodon's hostname or baseUrl (Optional)
const mstdn = new Mastodon(ACCESS_TOKEN, BASE_URL)

See documents of class Mastodon

CDN

for development: https://rawgit.com/onsen-ui/mstdn/master/dist/mastodon.min.js provided by rawgit.com

variable 'Mastodon' (window.Mastodon) is globally exported.

/* global Mastodon */  
const mastodon = new Mastodon('YOUR_ACCESS_TOKEN')

See documents of class Mastodon

./dist/mastodon.js is generated by webpack (as bundler)
and ./dist/mastodon.min.js is generated by uglifyJS

Documents

Documents automatically generated by Typedoc2.

At first, see ./docs/classes/_mastodon_.mastodon.html
hosted by rawgit: documents of class Mastodon

Contributing

Feel free to contact me.
Welcome to blush my English and the code up.