Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
destream-api
Advanced tools
destream-api currently supports:
$ npm i destream-api
or with yarn
$ yarn add destream-api
const DeStreamAPI = require('destream-api')
let destream = new DeStreamAPI({clientId: '12345', clientSecret: 'secret-secret-secret'})
async function registerMe() {
let response = await destream.registerUser('vityaschel@utidteam.com')
console.log(response)
} registerMe()
DeStream API Documentation (ru)
Exchanges authorization code from oauth to access token, refresh token, token type.
Example usage:
let { access_token, refresh_token, token_type } = await destream.getTokensFromCode('lk12j3a1p', 'https://destream.ru/')
Refreshes access token so it won't expire.
Example usage:
let { access_token, refresh_token, token_type } = await destream.refreshAccessToken('profile+tips', '2QwlfWHU7OYs')
Gets user which gave your app access to its account.
Example usage:
let { data } = await destream.getUser('token_type', '3jjprwOCd1Gi')
console.log(data.nickname, data.email)
Exchanges authorization code from oauth to access token, refresh token, token type.
Example usage:
let { access_token, refresh_token, token_type } = await destream.getTokensFromCode('lk12j3a1p', 'https://destream.ru/')
Register new user on destream with specified email.
Example usage:
let newUser = await destream.registerUser('help@gmail.com')
if(newUser.status === 409) { throw 'User exists!' }
console.log('User created!', newUser.data.user_id)
Gets latest tips. Tokens is an object: { token_type: 'string', access_token: 'string' }; Everything else is optional: offset and limit are Numbers; sinceDate is Date object
Example usage:
let { data, total } = await destream.getTips({'token_type', '3jjprwOCd1Gi'})
console.log('You have', total, 'tips with total amount sum of', data.reduce((prev, cur) => prev+cur.amount, 0), '!')
Subscribes you to websocket server which sends you messages such as donationReceived. Callback function is called every time with exactly 1 argument: message text.
Example usage:
destream.subscribeToEvents('lk12j3a1p', message => {
console.log('WOO HOOO! DONATE!!!', message.sender, 'I LOVE YOU SO MUCH thanks for', message.amount, message.currency)
})
I call it invoices because it is literally invoice: user is redirected directly to pay page. No forms needed to be filled by user.
Creates an invoice with specified parameters. All optional but 3: user id, amount and currency. additional_data must be a string.
Example usage:
let invoice = await destream.createInvoice(81923, 100, 'RUB')
console.log('Invoice with', invoice.data.payment_id, 'created. Now please go to', invoice.data.payment_url)
Gets information about created invoices. Tokens is an object: { token_type: 'string', access_token: 'string' }; Everything else is optional: offset and limit are Numbers; sinceDate is Date object; arrayOfIds must be an array of numbers (payment_ids)
Example usage:
let tenCreatedInvoices = await destream.getInvoicesPayments({'token_type', '3jjprwOCd1Gi'})
console.log('You created these invoices: ', ...tenCreatedInvoices.data.map(invoice => invoice.payment_id))
FAQs
Full featured DeStream API NodeJS wrapper [BETA]
The npm package destream-api receives a total of 8 weekly downloads. As such, destream-api popularity was classified as not popular.
We found that destream-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.