New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

socialblade

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socialblade - npm Package Compare versions

Comparing version 0.0.7 to 1.0.0

.prettierrc

43

package.json
{
"name": "socialblade",
"version": "0.0.7",
"version": "1.0.0",
"description": "Library for Social Blade's Official API in JavaScript (TypeScript)",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "mocha --reporter spec --require ts-node/register tests/*.test.ts",
"lint": "tslint --project tsconfig.json --format stylish src/**/*.ts",
"build": "tsc --module commonjs",
"dev": "ts-node-dev --respawn ./lib/index.ts",
"test": "mocha --reporter spec --require ts-node/register tests/*.ts",
"tdd": "mocha --reporter min --require ts-node/register --watch-files tests/ --watch-files lib/ --watch --recursive tests/*.ts",
"prepublish": "npm run build"
},
"repository": "https://github.com/TimothyCole/socialblade-js",
"repository": "https://github.com/SocialBlade/socialblade-js",
"bugs": {
"url": "https://github.com/TimothyCole/socialblade-js/issues"
"url": "https://github.com/SocialBlade/socialblade-js/issues"
},

@@ -20,22 +21,18 @@ "keywords": [

"social blade",
"modesttim",
"Timothy Cole"
"socialblade api",
"socialblade.com"
],
"author": "Timothy Cole <tim@socialblade.com>",
"license": "BSD 3-Clause",
"private": false,
"devDependencies": {
"@types/chai": "^4.1.5",
"@types/mocha": "^5.2.5",
"@types/request": "^2.47.1",
"@types/request-promise-native": "^1.0.15",
"chai": "^4.1.2",
"mocha": "^5.2.0",
"ts-node": "^7.0.1",
"typescript": "^3.0.3"
},
"dependencies": {
"request": "^2.88.0",
"request-promise-native": "^1.0.5"
"@types/chai": "^4.2.12",
"@types/mocha": "^8.0.3",
"@types/node": "^14.10.1",
"chai": "^4.2.0",
"isomorphic-unfetch": "^3.0.0",
"mocha": "^8.1.3",
"prettier": "^2.1.1",
"ts-node": "^9.0.0",
"typescript": "^4.0.2"
}
}

@@ -1,19 +0,14 @@

# Social Blade API in JavaScript [<img align="right" src="https://cdn.tcole.me/socialblade-small.png">](https://github.com/TimothyCole/socialblade-js)
# Social Blade API in TypeScript [<img align="right" src="https://socialblade.com/images/media/red/2.png">](https://socialblade.com/b)
[![Build Status](https://travis-ci.com/TimothyCole/socialblade-js.svg?branch=master)](https://travis-ci.com/TimothyCole/socialblade-js)
[![npm](https://img.shields.io/npm/v/socialblade.svg)](https://www.npmjs.com/package/socialblade)
[![Personal Discord](https://img.shields.io/discord/313591755180081153.svg?label=Personal%20Discord&colorB=308bcd&maxAge=3600)](https://discordapp.com/invite/YFtfGwq)
[![Social Blade Discord](https://img.shields.io/discord/125022847562285056.svg?label=Social%20Blade%20Discord%20(Not%20for%20Support)&colorB=c84329&maxAge=3600)](https://socialblade.com/discord)
![Discord](https://img.shields.io/discord/125022847562285056?color=7289DA&label=Discord)
---
### Information and Disclaimer
Just because I work for Social Blade does not mean this is an official library. Though it is used in Social Blade official products.
### API Information
Our API allows you to take the power of the Social Blade website and intergrate it directly into your internal systems.
This library supports most of the `api.socialblade.com` endpoints that are being exposed by either the official Social Blade Browser Extensions, Apps, or Website.
You gain access to the same public statistical information that is on the website along with our toplists, rankings, and more as we keep expanding it's features!
[<img align="right" height="40px" src="https://cdn.t.pics/socialblade-get-started.png">](https://socialblade.com/business-api)
Social Blade's API is a private API used for Social Blade official tools and for companies with express written permission. Use of the Social Blade API without express permission is prohibited by the active [Terms of Service](https://socialblade.com/info/terms) and may result in being blocked from the Social Blade website and all of it's data.
---
## Install

@@ -24,20 +19,15 @@ ```bash

> **Important**: Library does not force any fetch polyfills, If you don't already have a fetch polyfill we recommend using `isomorphic-unfetch` like the tests use.
## Usage
Import the library into your project and construct a new client which will be used to access the API.
Use either the third-party `Auth` function or first-party `AuthAsUser` function to set the client as "active".
#### TypeScript
```ts
import { SocialBladeClient } from 'socialblade';
import SocialBlade, { YouTubeUser } from 'socialblade';
const socialblade: SocialBladeClient = new SocialBladeClient();
// Third-Party Auth
socialblade.Auth("Third-Party API Key").then((data: IDeveloper) => {
console.log(data)
});
const client: SocialBlade = new SocialBlade(SOCIALBLADE_CLIENT_ID, SOCIALBLADE_ACCESS_TOKEN);
// First-Party Auth
socialblade.AuthAsUser("User Email", "User Access Token").then((data: IUser) => {
console.log(data)
});
// Get a YouTube User
const sbUser: YouTubeUser = await client.youtube.user('socialblade');
```

@@ -47,18 +37,14 @@

```js
const SocialBladeClient = require("socialblade").SocialBladeClient;
const SocialBlade = require("socialblade");
const socialblade = new SocialBladeClient();
// Third-Party Auth
socialblade.Auth("Third-Party API Key").then(console.log)
const client = new SocialBlade(SOCIALBLADE_CLIENT_ID, SOCIALBLADE_ACCESS_TOKEN);
// First-Party Auth
socialblade.AuthAsUser("User Email", "User Access Token").then(console.log)
// Get a YouTube User
client.youtube.user('socialblade').then(console.log);
```
## Examples
#### Get YouTube Channel Stats &mdash; [ [Third-Party Auth](examples/youtube-stats-Auth.js), [First-Party Auth](examples/youtube-stats-AuthAsUser.js) ]
#### Get Twitch Channel Stats &mdash; [ [Third-Party Auth](examples/twitch-stats-Auth.js), [First-Party Auth](examples/twitch-stats-AuthAsUser.js) ]
_More examples coming soon. Library still early development_
##### [Code Examples](examples)
## Troubleshooting
If you have official access to the Social Blade API via express permission from the company then feel free to contact me via [Twitter](https://twitter.com/messages/compose?recipient_id=1690693537) or [email me](mailto:tim@timcole.me?cc=tim@socialblade.com&subject=Social%20Blade%20JavaScript%20Library%20Inquiry) for any help.
If you find an issue with this library feel free to open an issue here on GitHub, or submit a PR and others! 😀
If it's an issue when the API open a [support ticket](https://support.socialblade.com).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc