Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Repository files navigation

rescueTABLET missions-client

This is a client library to work with the Missions Service of rescueTABLET. It allows you to create, update, delete and retrieve missions as well as subscribe to real-time updates.

Sorry for the lack of documentation, this is a work in progress.

Caution

This library is still under heavy development. Until we've reached a stable 1.0.0 version, please expect breaking changes even in minor releases.

Installation

Add the following line to .npmrc in your project directory (create the file if it doesn't exist yet):

@rescuetablet:registry=https://npm.pkg.github.com/

Install the library and its peer dependencies in your project:

npm i @rescuetablet/missions-client firebase

Usage

Browser

import { createMissionsManager } from "@rescuetablet/missions-client/browser";

const manager = await createMissionsManager();
await manager.authorize(missionsApiKey);

React

import { createMissionsManager } from "@rescuetablet/missions-client/browser";
import {
  useMissions,
  useMissionsUser,
  MissionsContextProvider,
} from "@rescuetablet/missions-client/react";

// create the manager as described above
// const manager = …

export default function App() {
  return (
    <MissionsContextProvider manager={manager}>
      <Main />
    </MissionsContextProvider>
  );
}

function Main() {
  const missions = useMissions();
  const user = useMissionsUser();

  return <pre>{JSON.stringify({ missions, user }, null, 2)}</pre>;
}

TypeScript Types

We export all types used in the API. You can import them like this:

import { type Mission } from "@rescuetablet/missions-client";

API Client

We provide a Hey API implementation to interact with the API. Use manager.getClientOptions() to get the client configuration including base URL, user agent and API token.

import { createMission } from "@rescuetablet/missions-client/client";

// create the manager as described above
// const manager = …

await createMission({
  ...manager.getClientOptions(),
  data: {
    keyword: "TEST",
    message: "Test Mission",
    // more mission data
  },
  throwOnError: true,
});

Real-Time Updates

The manager object provides a way to subscribe to real-time updates. You can listen to changes in missions like this:

manager.on("mission_added", (mission) => {
  console.log("Mission updated", mission);
});

Maintainers

This library is provided as is under an MIT license by rescueTABLET.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages