shrub/pkg/npm/api
Liam Fitzgerald 7205625abf wip
2022-02-01 13:25:28 -06:00
..
contacts interface: fix sharing private profile 2021-09-23 12:11:05 +10:00
docket grid: autoally on leap 2021-10-04 16:01:35 +10:00
graph graph-store: bump update mark 2021-09-28 12:50:45 +10:00
groups interface: hide aborted requests 2021-12-07 11:02:23 -05:00
hark landscape: update notification reducing for new hark 2021-10-05 14:10:02 +10:00
hood garden: update docket, jam 2021-09-29 20:01:30 +10:00
invite @urbit/api: fix build 2021-07-02 10:40:56 +10:00
lib api: handling 000000 hexToUX 2021-11-30 16:56:49 -06:00
metadata interface: fix tsc errors 2021-08-30 10:54:09 +10:00
s3 npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
settings settings-store: query by desk 2021-09-09 11:35:57 +10:00
term webterm: handle old-style blits and belts 2021-12-08 17:12:38 +01:00
tmp wip 2022-02-01 13:25:28 -06:00
.eslintrc.js npm/api: correct metadata resource interface 2021-07-07 12:24:52 -04:00
deps.d.ts @urbit/api: update graph pokes, scries 2021-06-10 12:01:25 +10:00
index.ts @urbit/api: add docket bindings 2021-08-23 08:04:06 +10:00
package-lock.json Merge remote-tracking branch 'origin/dist' into lf/nu-hark-store 2021-09-17 12:57:56 +10:00
package.json npm-api: fixing hexToUx converter 2021-11-24 19:54:47 -06:00
README.md npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
tsconfig.json @urbit/api: fix build 2021-07-02 10:40:56 +10: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.