Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

shariff

> 前端框架
Open source

Shariff enables website users to share their favorite content without compromising their privacy.

1.4K stars0 likes3 views
WebsiteGitHub

About

Shariff enables website users to share their favorite content without compromising their privacy.

Shariff – Give Social Media Buttons Some Privacy

Shariff enables website users to share their favorite content without compromising their privacy. Demo

Some social service providers like e.g. Facebook supply official sharing code snippets which quietly siphon personal data from all page visitors. Shariff enables visitors to see how popular your page is on Facebook and share your content with others without needless data leaks.

Shariff (/ˈʃɛɹɪf/) is an open-source, low-maintenance, high-privacy solution maintained by German computer magazine c't and heise online.

Shariff consists of two parts: a simple JavaScript client library and an optional server-side component. The latter fetches the number of likes or shares. Share buttons and share counts work without a connection between your visitors' browsers and social networks (unless they decide to share, of course).

Getting Started

  1. Download the latest release

  2. Upload all files included in the release

  3. Include CSS in <head>:

    • shariff.complete.css uses the dependencies included in the release files
    • if Font Awesome is already included in your site, use build/shariff.min.css
  4. Include JavaScript right before </body>:

    • shariff.complete.js uses the dependencies included in the release files
    • if jQuery is already included in your site, use build/shariff.min.js
  5. Insert one or more `

    More advanced buttons:


## Getting Started using `npm`

You can also use Shariff's node package by installing it via `npm`:

```sh
$ cd my-project
$ npm install shariff --save

Edit your JS main script, include Shariff and initialize it in one or more containers:

javascript
// my-app.js
var Shariff = require('shariff');
var $ = require('jquery');
var buttonsContainer = $('.some-selector');
new Shariff(buttonsContainer, {
    orientation: 'vertical'
});

Running demo site

After downloading Shariff, install its dependencies by running npm install.

bash
$ git clone https://github.com/heiseonline/shariff.git
$ cd shariff
$ npm install
$ npm run dev

…

js
var buttonsContainer = $('.some-selector');
new Shariff(buttonsContainer, {
    backendUrl: '/my/backend/url',
    orientation: 'vertical',
    mailUrl: 'mailto:[email protected]',
});

Events

Shariff buttons emit the shariff-share event if they are clicked.

javascript
$('body').on('shariff-share', function(event) {
    var service = event.details;
    ...
});

This can be used to track shares using analytics software. It is recommended to register the event handler only after the analytics script becomes available.

Piwik example:

javascript
(function() {
  var _my_piwik_onload = function() {
    var piwik = this;

    $('body').on('shariff-share', function(event) {
      var service = event.detail;
      piwik.trackEvent('Sharing', service.name);
    });
  }

  _paq.push([ _my_piwik_onload ]);
})();

Supported browsers

Shariff supports the following Browsers:

  • Firefox
  • Google Chrome
  • Internet Explorer/Edge
  • Safari

The current and previous major releases of Firefox, Google Chrome, Internet Explorer/Edge and Safari are supported on a rolling basis.

Supported services

Shariff supports the following social sharing services:

  • buffer
  • diaspora*
  • facebook
  • Flattr
  • Flipboard
  • LinkedIn
  • Mail
  • Pinterest
  • Pocket
  • Print
  • Qzone
  • reddit
  • StumbleUpon
  • Telegram
  • Tencent Weibo
  • Threema
  • Tumblr
  • Twitter
  • VK
  • Weibo
  • WhatsApp
  • XING

In addition, the service Info provides a button to show an info page about the social sharing buttons. The URL of this page can be set with an option. Default value: https://ct.de/-2467514, i.e. the c't article introducing Shariff.

Backends

In order to display share counts with Shariff, you need the following backend:

  • shariff-backend-php

Third-party backends:

  • shariff-backend-java

Once you have one of these backends up and running, insert its URL into the data-backend-url attribute. For example, if the backend runs under https://example.com/my-shariff-backend/, the data-backend-url should be /my-shariff-backend/. The script will handle the rest.

Third-party integrations

This is a list of integrations for third-party systems:

  • Contao integration
  • Drupal module
  • Joomla! 3 Shariff Plugin
  • Kirby-CMS Shariff-Plugin
  • MediaWiki Extension
  • Open Monograph Press Plugin
  • Pagekit Extension
  • Serendipity
  • SilverStripe Module
  • Symfony ShariffBundle
  • TYPO3 Plugin rx_shariff
  • Wordpress Plugin shariff-sharing
  • WordPress Plugin Shariff Wrapper
  • Xenforo [ITM] ctSSB for Xenforo 1.5
  • Xenforo [WMTech] Social Share Privacy Plugin
  • Magento 2 Shariff Social Share

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptcssfrontendjavascriptprivacy

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架