@thisismissem/adonisjs-atproto-tap
v2.0.1
Published
Adonis.js provider for AT Protocol Tap Client
Maintainers
Readme
AdonisJS AT Protocol Tap
This package provides a small Adonis.js provider and services for @atproto/tap, which allows interacting with Tap for AT Protocol development.
Installation
node ace add @thisismissem/adonisjs-atproto-tapConfiguring
If you didn't use node ace add you can later run the configuration using:
node ace configure @thisismissem/adonisjs-atproto-tapIndexer
The Tap Indexer (SimpleIndexer) can be accessed using:
import indexer from '@thisismissem/adonisjs-atproto-tap/services/indexer'If you've installed using the instructions above, you will have the file start/indexer.ts created, which is where you can add the logic to handle the events from Tap. The provider automatically connects the indexer.error() handler to the Adonis.js logger.
You can find out more in the @atproto/tap documentation
Tap API
The Tap Client API for adding and removing repositories, resolving DIDs and such is accessible via:
import tap from '@thisismissem/adonisjs-atproto-tap/services/tap'Which provides the following methods for interacting with the Tap server:
addRepos(dids: string[]): Promise<void>- Add repos to track (triggers backfill)removeRepos(dids: string[]): Promise<void>- Stop tracking reposresolveDid(did: string): Promise<DidDocument | null>- Resolve a DID to its DID documentgetRepoInfo(did: string): Promise<RepoInfo>- Get info about a tracked repo
Docker Setup for Tap
To run Tap locally, you'll likely want a docker-compose.yaml file with the following contents:
services:
tap:
image: ghcr.io/bluesky-social/indigo/tap:latest
platform: linux/amd64
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:2480/health"]
interval: 2s
retries: 5
start_period: 10s
timeout: 10s
volumes:
- ./data/tap:/data
env_file: tap.env
environment:
TAP_BIND: :2480
ports:
- "127.0.0.1:2480:2480"The tap.env file looks like:
TAP_SIGNAL_COLLECTION=fyi.questionable.actor.profile
TAP_COLLECTION_FILTERS=fyi.questionable.*
TAP_ADMIN_PASSWORD=admin-passwordFor the full configuration see the Tap documentation. You cannot use TAP_WEBHOOK_URL with this package, since it depends on the WebSocket interface.
