Skip to content
Javascript SDK for Cinchy
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Cinchy Javascript-SDK


Add the cinchy.js file to your project and include the script in the html pages that use it.


<script src="js/cinchy.js"></script>

Please use v2.x.x of the library if you are using Cinchy v2.x.x and higher, otherwise, use v1.x.x.


To connect to Cinchy, you must configure the window's cinchyJS object in your javascript code:

window.cinchyJS = new CinchyJS({
    // The url of your Cinchy instance
    cinchyRootUrl: '',
    // The identity server of your Cinchy instance
    authority: '',
    // The client id for your applet
    client_id: 'javascript-sample',
    // (Optional) The requested scopes for the applet (must be permitted for the client)
    // You must have openid and id requested
    scope: 'openid id email profile roles',
    // (Optional) Enable silent refresh
    silent_refresh_enabled: true,
    // (Optional) (Mandatory if silentRefreshEnabled = true) The silent refresh url
    silent_redirect_uri: 'http://localhost:3000/silent-refresh.html',
    // The callback function that gets executed after login
    user_loaded_callback: initialize

Enabling Silent Refresh

In order to use silent refresh, you must:

1). Set the silent_refresh_enabled property to true in your CinchyJS object.

2). Add a silent-refresh.html file into your project. This can be found within the repo folder in the repo or copy & paste this (modify the script src location to where your cinchy.js file is):

<!DOCTYPE html>
<html xmlns="">
    <script src="/js/cinchy.js"></script>
        new Oidc.UserManager().signinSilentCallback().catch((err) => {

Silent refresh works by using a hidden iframe to access a url that contains the silent-refresh.html page. This iframe makes a request to the server to retrieve a new access token.

3). Add the silent-refresh url into the "Permitted Login Redirect URLs" field of the "Integrated Clients" table within Cinchy (eg. http://localhost:3000/silent-refresh.html).


This project is license under the terms of the GNU General Public License v3.0

You can’t perform that action at this time.