Ckd React Examples

Uses

Type info

const useCkd: () => {
  connected: boolean; // is Ckd available on localhost:1818?
  signedIn: () => boolean; // are we signed in?
};

Source code

import { useCkd } from "ckd-react";

export default function UseCkdExample() {
  const ckd = useCkd();

  return (
    <pre>
      {JSON.stringify(
        {
          connected: ckd.connected,
          "signedIn()": ckd.signedIn(),
        },
        null,
        2
      )}
    </pre>
  );
}

*sign in required

Try it

{
  "connected": false,
  "signedIn()": false
}