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

@atcute/pckt#

pckt (blog.pckt.*) schema definitions

npm install @atcute/pckt

usage#

import { BlogPcktPublication } from '@atcute/pckt';
import { is } from '@atcute/lexicons';

const publication: BlogPcktPublication.Main = {
	$type: 'blog.pckt.publication',
	name: 'my blog',
	basePath: 'https://example.pckt.blog',
	createdAt: new Date().toISOString(),
};

is(BlogPcktPublication.mainSchema, publication);
// -> true

with @atcute/client#

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

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

with @atcute/lex-cli#

when building your own lexicons that reference pckt 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/pckt'],
});