Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
/ sdk Public archive

Easily add Citadel support to your app (for apps not running on a Citadel node itself)

Notifications You must be signed in to change notification settings

runcitadel/sdk

Repository files navigation

Citadel SDK

Lightweight, type-safe wrapper around the Citadel API.

The Citadel SDK allows you to easily interact with a Citadel node on the local network in your app. It can power your app, but will also be used in the new Citadel dashboard and mobile app.

Note about ES Modules

This package uses ES Modules. It can only be imported in projects using ESM. Trying to require() it will fail.

Simple example

import {Citadel} from "@runcitadel/sdk";

console.log("Initializing testing...");
// Try to discover a Citadel
let node = await Citadel.discover() || "http://localhost";
let citadel = new Citadel(node);
console.log("Checking online state...");
console.log(await citadel.isOnline());
console.log("Logging in...");
await citadel.login("password123!", true);
console.log("Testing connection...");
await citadel.manager.auth.test();

About

Easily add Citadel support to your app (for apps not running on a Citadel node itself)

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published