@atlasprotocol/connector-framework
v0.3.3
Published
Connector framework for ATLAS Protocol. Defines the Connector interface, capability descriptors, auth contexts, search params, and structured error types used by source-platform adapters.
Downloads
1,357
Maintainers
Readme
@atlasprotocol/connector-framework
The @atlasprotocol/connector-framework package defines the contract every source-platform adapter implements so an ATLAS host can index, search, and fetch events from heterogeneous ticketing platforms (Eventbrite, Lu.ma, Meetup, etc.) through one uniform interface. It ships only types, capability descriptors, and structured error classes — there is no runtime dependency on any specific platform, and connectors stay stateless with respect to credentials by accepting an AuthContext per call.
How to write a connector
- Add
@atlasprotocol/connector-frameworkto your package dependencies. The protocol types you'll return (AtlasEvent,AtlasTicketType) come from@atlasprotocol/typesand are pulled in transitively. Add@atlasprotocol/server-sdkonly if you need the runtimeAtlasEventSchemazod validator (re-exported from this package as a convenience). - Export an object that implements the
Connectorinterface:- Set
id,name, andauthMethod('oauth2'or'apikey'). - Declare
capabilitiesso the host knows which operations to expose. - Implement
search,getEvent, andlistTicketTypes. Each method receives the request parameters plus anAuthContextand returns ATLAS-shaped data (AtlasEvent,AtlasTicketType— both imported from@atlasprotocol/types).
- Set
- Map upstream errors to the framework's error types: throw
AuthExpiredErroron 401,RateLimitError(message, retryAfterSeconds)on 429, and returnnullfromgetEventfor 404 (do not throw). - Keep mappers as pure functions in a
mappers.tsso they can be unit tested against deterministic fixtures.
See examples/connector-eventbrite for a complete reference implementation that covers OAuth2 PKCE, REST pagination, and field-by-field upstream → ATLAS mapping with full test coverage.
License
MIT
