a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
README.md

@atcute/tangled#

Tangled (sh.tangled.*) schema definitions

npm install @atcute/tangled

usage#

import { ShTangledRepoPullComment } from '@atcute/tangled';
import { is } from '@atcute/lexicons';

const comment: ShTangledRepoPullComment.Main = {
	$type: 'sh.tangled.repo.pull.comment',
	repo: 'at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.repo/3liuighjy2h22',
	pull: 'at://did:plc:ia76kvnndjutgedggx2ibrem/sh.tangled.repo.pull/3lp3tg57oyv22',
	owner: 'did:plc:ia76kvnndjutgedggx2ibrem',
	createdAt: '2025-05-14T01:29:08Z',
	body: 'not sure what went wrong with that first round (probably pasted the diffs wrong) but I think this should work',
};

is(ShTangledRepoPullComment.mainSchema, comment);
// -> true

with @atcute/client#

pick either one of these 3 options to register the ambient declarations

// tsconfig.json
{
	"compilerOptions": {
		"types": ["@atcute/tangled"],
	},
}
// env.d.ts
/// <reference types="@atcute/tangled" />
// index.ts
import type {} from '@atcute/tangled';

now all the XRPC operations should be visible in the client

with @atcute/lex-cli#

when building your own lexicons that reference Tangled types, configure lex-cli to import from this package:

// file: lex.config.js
import { defineLexiconConfig } from '@atcute/lex-cli';

export default defineLexiconConfig({
	files: ['lexicons/**/*.json'],
	outdir: 'src/lexicons/',
	imports: ['@atcute/tangled'],
});