Summary

Introduction

GraphJS is a Javascript client-side library to help developers easily enable social features on their web sites. GraphJS is built upon the Pho framework, and it's open source. With only a few lines of code, you can easily add authentication, comments, messages, forum, groups, profiles etc. to your static web pages.

Getting Started

For a quick intro, read this blog post by the founder of Graph.js, and don't forget to give applause 😃

To get started with GraphJS, you need to include graph.js file to your project. Then you can initiate it with GraphJS.init function.

Simply, add this code into your HTML, just before the end of body tag. Don't forget to replace your public ID, theme, color, language and defaultAvatar options as follows:

...

To clarify:

  • Your public ID should be a string which can be provided by GraphJS after Setup process.
  • Theme option should be a string, and it has to be either 'light' or 'dark'.
  • Color option should be a string representing any color of your preference in HEX format.
  • The defaultAvatar option should point to an jpg, gif or png image or it should be simply "gravatar" so that all undefined avatars are based off of user's email address as per Gravatar protocol.
  • Also, please note, as of the time of this writing, the only languages supported by GraphJS are French (alpha), Turkish and English. If the language option is left blank, the tags will display in English. For most updated languages, you may check GraphJS Github Repository