shrub/pkg/npm/api
Matilde Park d00b577c56 landscape: remove duplicate slash in scry path
getNode added a duplicate slash before the index, resulting in bad scry
paths. This removes that slash.
2021-06-24 12:09:22 -05:00
..
contacts @urbit/api: update contact pokes 2021-06-09 12:33:41 +10:00
graph landscape: remove duplicate slash in scry path 2021-06-24 12:09:22 -05:00
groups @urbit/api: update group pokes 2021-06-09 11:42:27 +10:00
hark Merge remote-tracking branch 'origin/release/next-userspace' into lf/npm-typings 2021-06-14 12:00:02 +10:00
invite api: brought to parity with livenet 2021-02-24 19:54:00 -08:00
lib @urbit/api: faster BigIntOrderedMap size accessor 2021-06-15 12:14:49 +10: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 @urbit/api: update settings pokes, scries 2021-06-09 13:02:55 +10:00
.eslintrc.js added NPM packages 2021-01-26 21:45:18 -08:00
deps.d.ts @urbit/api: update graph pokes, scries 2021-06-10 12:01:25 +10:00
index.ts npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
package-lock.json @urbit/api: update graph pokes, scries 2021-06-10 12:01:25 +10:00
package.json Merge 923e6683a6 into release/next-userspace 2021-06-17 19:23:12 +04:00
README.md npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
tsconfig.json npm: fix compatibility with create-urbit-app 2021-06-16 17:24:40 -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.