Due to CORS restrictions, you're going to have a really hard time using this library in the browser. Although GET endpoints on the Tumblr API support JSONP, this library is not intended for in-browser use. Sorry!
The unofficial JavaScript client library for both Tumblr API v2 and v1 intended for use in browser. (splitted from chooslr/chooslr-api)
yarn add tumblrinbrowser
import Tumblr from 'tumblrinbrowser'
const tumblr = new Tumblr({ api_key, proxy })
Required at least one either.
result: Promise<Blog>
result: Promise<Post[]>
type
tag
id
limit
offset
reblog_info
notes_info
filter
result: Promise<number>
type
tag
result: Promise<Post>
reblog_info
notes_info
result: Promise<Post[]>
/ Promise<Tag[]>
name
denom
maxLimit
params
const supply = await tumblr.generatePosts({ name })
const { done, value: posts } = await supply()
const { done, value: posts } = await supply()
result: Promise<SupplyFn>
(tiloop
's)
name
random
params
import * as v2 from 'tumblrinbrowser'
const url = v2.avatar(name[, size])
const blog = await v2.blog({ api_key, proxy, name })
const posts = await v2.posts({ api_key, proxy, name, params })
const total = await v2.total({ api_key, proxy, name, params })
const post = await v2.post({ api_key, proxy, name, id, params })
const posts = await v2.samplingPosts({ api_key, proxy, name, denom, maxLimit, params })
const tags = await v2.samplingTags({ api_key, proxy, name, denom, maxLimit, params })
const supply = await v2.generatePosts({ api_key, proxy, name, random, params })
import * as v1 from 'tumblrinbrowser/v1'
const blog = await v1.blog(name[, timeout])
const posts = await v1.posts(name[, params, timeout])
const total = await v1.total(name[, params, timeout])
const post = await v1.post(name, id[, params, timeout])
const posts = await v1.search(name, word[, page, timeout])
const posts = await v1.samplingPosts({ name, params, denom, maxLimit, timeout })
const tags = await v1.samplingTags({ name, params, denom, maxLimit, timeout })
const supply = await v1.generatePosts({ name, params, random, timeout })
const supply = await v1.generateSearch({ name, word, timeout })