In the digital age, privacy has become a premium, especially when it comes to sharing content online. Traditional social media buttons can often leak personal data, but fortunately, Shariff offers a solution that allows users to share favorite content without compromising their privacy. This guide walks you through the steps to integrate Shariff into your website seamlessly.
What is Shariff?
Shariff is an open-source, low-maintenance, high-privacy solution developed by the German computer magazine ct and heise online. It allows visitors to understand how popular a page is on social networks without the risk of their data being siphoned off by social media providers. Shariff consists of a simple JavaScript client library and an optional server-side component that fetches share counts.
Getting Started with Shariff
Follow these steps to integrate Shariff into your website:
- Download the latest release: You can get it from the official GitHub release page.
- Upload all files: After downloading, upload all files included in the release to your web server.
- Include CSS in the head:
- Use
shariff.complete.cssif you want all the dependencies included in your release files. - If you have already included Font Awesome, use
build.shariff.min.css.
- Use
- Include JavaScript:
- Place
shariff.complete.jsright before the closingbodytag. - If you are using jQuery, use
build.shariff.min.js.
- Place
- Insert the shariff element: Add
<div class="shariff"></div>where you want the buttons to appear. - Customize look: Use
data-* attributesto modify the appearance and settings of your Shariff buttons.
Usage Example
Here’s a straightforward HTML example demonstrating how to set up Shariff:
<!DOCTYPE html>
<html>
<head>
<link href="path/to/shariff.min.css" rel="stylesheet">
</head>
<body>
<h1>My Article</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<h2>Minimum buttons:</h2>
<div class="shariff"></div>
<h2>More advanced buttons:</h2>
<div class="shariff" data-backend-url="path/to/backend" data-url="https://www.example.com/my-article.html" data-theme="grey" data-orientation="vertical"></div>
<!-- immediately before body -->
<script src="path/to/shariff.min.js"></script>
</body>
</html>
Installation via npm
If you prefer using npm, you can install Shariff with the following commands:
cd my-project
npm install shariff --save
Edit your main JavaScript file as follows:
var Shariff = require('shariff');
var $ = require('jquery');
var buttonsContainer = $('.some-selector');
new Shariff(buttonsContainer, {
orientation: 'vertical'
});
Troubleshooting
If you run into issues while integrating Shariff, here are some troubleshooting steps you can take:
- Ensure that all paths to CSS and JavaScript files are correct.
- Verify that you include jQuery before the Shariff script if you are using jQuery.
- Check your console for any JavaScript errors that might prevent the buttons from rendering.
- Consult the Shariff GitHub page for additional help and insights.
- For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
Shariff is a robust solution for privacy-conscious sharing on social media. By following the steps outlined above, you can effectively integrate Shariff into your website and provide your users with a safe sharing option. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

