Skip to content

Instantly share code, notes, and snippets.

@eyeccc
Last active August 28, 2018 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyeccc/c39e2f31131b43dbef2a2a664cfd5119 to your computer and use it in GitHub Desktop.
Save eyeccc/c39e2f31131b43dbef2a2a664cfd5119 to your computer and use it in GitHub Desktop.
type keycloak;
type init;
type initParam;
[@bs.module] external keycloak : string => keycloak = "keycloak-js";
[@bs.obj] external makeInitParam : (~onLoad: string, unit) => initParam = "";
[@bs.send] external init : (keycloak, initParam) => Js.Promise.t(bool) = "";
let myConfig = "./keycloakConfig.json";
let auth = myConfig |> keycloak |. init(makeInitParam(~onLoad="login-required", ())));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment