devin ivy aea590ef37
Auth in XRPC server ()
* Add auth to xrpc-server, refactor to use per-route middleware stack

* Add xrpc-server error middleware, tidy

* Tests in xrpc for for catchall errors and auth

* Tidy

* Update lex-cli for new xrpc-server auth interface

* Update pds lexicon w/ codegen for xrpc auth

* Use xrpc-server auth in pds

* Update tests for newly-required auth
2022-12-05 23:46:21 -05:00
..
2022-12-05 23:46:21 -05:00
2022-07-14 18:36:23 -05:00

ATP API

Usage

import API from '@atproto/api'

const client = API.service('http://example.com')

// xrpc methods
const res1 = await client.com.atproto.repo.createRecord(
  {
    did: alice.did,
    collection: 'app.bsky.feed.post',
    record: {
      $type: 'app.bsky.feed.post',
      text: 'Hello, world!',
      createdAt: (new Date()).toISOString()
    }
  }
)
const res2 = await client.com.atproto.repo.listRecords({did: alice.did, type: 'app.bsky.feed.post'})

// repo record methods
const res3 = await client.app.bsky.feed.post.create({did: alice.did}, {
  text: 'Hello, world!',
  createdAt: (new Date()).toISOString()
})
const res4 = await client.app.bsky.feed.post.list({did: alice.did})

License

MIT