shrub/pkg/npm/api
2021-06-09 10:48:28 +10:00
..
contacts npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
graph interface: strip api.hark 2021-06-08 16:00:37 +10:00
groups npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
hark @urbit/api: update hark pokes 2021-06-08 15:48:03 +10:00
invite api: brought to parity with livenet 2021-02-24 19:54:00 -08:00
lib interface: threading works for complex graph structures 2021-05-18 18:04:27 -05:00
metadata @urbit/api: update metadata pokes 2021-06-09 10:48:28 +10:00
s3 npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
settings interface, npm/api: type checking, round 2 2021-04-28 17:18:30 -04:00
.eslintrc.js added NPM packages 2021-01-26 21:45:18 -08:00
index.ts npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
package-lock.json pkg/npm: update package-lock.json 2021-05-18 16:53:01 -04:00
package.json npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
README.md npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
tsconfig.json interface: type fixes, part 4 2021-05-05 17:20:29 -04:00

Urbit API in JavaScript

This package simplifies the process of working with Urbit's APIs into fluent, typed functions organized by app. Pairs well with @urbit/http-api. Compare:

Without:

import UrbitInterface from '@urbit/http-api';
const api: UrbitInterface = useApi();
api.poke({
  app: 'settings-store',
  mark: 'settings-event',
  json: {
    'put-entry': {
      'bucket-key': bucket,
      'entry-key': key,
      'value': value
    }
  }
});

With:

import UrbitInterface from '@urbit/http-api';
import { settings } from '@urbit/api';
const api: UrbitInterface = useApi();
api.poke(setings.putEntry(bucket, key, value));

You may import single functions

import { putEntry } from '@urbit/api';

or whole apps:

import { settings } from '@urbit/api';

This package also provides types and utilities for working with Urbit's internal data structures, such as Nouns, Das, Tas, and so forth.

This package was originally developed as part of Tlon's Landscape client and therefore the best reference material exists there.