Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

social-api-js

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

social-api-js

Social network API library

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Social API

A library that provides a standard JS interface to dynamically load (or lazy load) all social network APIs (good for sites that integrate multiple social network APIs together).

Supports the following APIs:

  • Facebook
  • Tumblr
  • Twitter
  • Instagram
  • Vine

Usage

In order to use this package, you must be using a compiler to utilize the latest ES6 javascript syntax. I recommend installing babel (or similiar) and importing the source files directly.

Facebook

import {Facebook} from 'social-api';
let options = {
  apiConfig: {appId: 'MyAP33IYEK3y'}
};
Facebook.load(options, function (FB) {
    // API loaded! Now, do something with the FB object
    console.log(FB);
});

Twitter

import {Twitter} from 'social-api';
Twitter.load({}, function (twttr) {
    // API loaded! Now, do something with the twitter object
    console.log(twttr);
});

Tumblr

import {Tumblr} from 'social-api';
let options = {
  apiConfig: {
     api_key: 'vtoiBQGHzJfvtNaFXK7T5DJdIM8ozpjPPzcF9z6EUxZDSELGxd',
     'base-hostname': 'janey-smith.tumblr.com'
 }
};
Tumblr.load(options, function () {
    // API loaded!
});

Instagram

import {Instagram} from 'social-api';
Instagram.load({}, function () {
    // API loaded!
});

Vine

import {Vine} from 'social-api';
let el = document.getElementsByTagName('div')[0];
Vine.load({}, function () {
    // API loaded! Show an embed
    el.innerHTML = '<iframe class="vine-embed" src="https://vine.co/v/sf90dfs/embed/simple" width="600" height="600" frameborder="0"></iframe>';
});

Keywords

FAQs

Package last updated on 12 Apr 2016

Did you know?

Socket

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.

Install

Related posts

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