btn.social
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

btn.social

UMD

<!-- Works with any HTML and CSS customization! -->
<link rel="stylesheet" href="theme.css"/>
<a href="https://login.btn.social/{APPID}/facebook" class="my-btn">
  <svg>...</svg> Login with Facebook
</a>

<!-- Load the SDK (1.5 kB) -->
<!-- Intercepts `<a href="https://login.btn.social/...">` clicks -->
<script async src="https://btn.social/v1/web.js"></script>
<script defer>
  // Manually trigger a pop-up window
  var paylaod = await btnsocial.popup('{APPID}', 'twitter', {
    // options
  });

  // Manually trigger a "_self" redirect
  btnsocial.redirect('{APPID}', 'github');
</script>

ESM

import { popup, redirect, listen } from 'btn.social';

// Intercept <a href="https://login.btn.social/..." clicks
var detach = listen({
  // options
});

// Manually trigger a pop-up window
var payload = popup('{APPID}', 'twitter', {
  // options
});

// Manually trigger a "_self" redirect
redirect('{APPID}', 'github');

Readme

Keywords

none

Package Sidebar

Install

npm i btn.social

Weekly Downloads

1

Version

0.1.3

License

none

Unpacked Size

9.6 kB

Total Files

6

Last publish

Collaborators

  • lukeed