Shariff enables website users to share their favorite content without compromising their privacy.
Shariff enables website users to share their favorite content without compromising their 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).
Download the latest release
Upload all files included in the release
Include CSS in <head>:
shariff.complete.css uses the dependencies included in the release filesbuild/shariff.min.cssInclude JavaScript right before </body>:
shariff.complete.js uses the dependencies included in the release filesbuild/shariff.min.jsInsert one or more `
## Getting Started using `npm`
You can also use Shariff's node package by installing it via `npm`:
```sh
$ cd my-project
$ npm install shariff --saveEdit your JS main script, include Shariff and initialize it in one or more containers:
// my-app.js
var Shariff = require('shariff');
var $ = require('jquery');
var buttonsContainer = $('.some-selector');
new Shariff(buttonsContainer, {
orientation: 'vertical'
});After downloading Shariff, install its dependencies by running npm install.
$ 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]',
});Shariff buttons emit the shariff-share event if they are clicked.
$('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:
(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 ]);
})();Shariff supports the following Browsers:
The current and previous major releases of Firefox, Google Chrome, Internet Explorer/Edge and Safari are supported on a rolling basis.
Shariff supports the following social sharing services:
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.
In order to display share counts with Shariff, you need the following backend:
Third-party backends:
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.
This is a list of integrations for third-party systems:
No open issues yet, or sync has not completed.