Skip to main content

AT Protocol documentation

Build decentralized social applications with the TypeScript reference implementation of the AT Protocol. Create clients, servers, and services that connect to the open social web.

Quick start

Get up and running with the AT Protocol SDK in minutes

1

Install the package

Install the @atproto/api package using your preferred package manager:
npm install @atproto/api
2

Create an authenticated session

Create a session and authenticate with your AT Protocol server:
import { Agent, CredentialSession } from '@atproto/api'

const session = new CredentialSession(new URL('https://bsky.social'))
await session.login({
  identifier: 'your.handle',
  password: 'your-app-password'
})
const agent = new Agent(session)
For production applications, use OAuth-based authentication instead of app passwords. See the OAuth authentication guide for details.
3

Make your first API call

Use the agent to interact with the AT Protocol:
// Create a post
const post = await agent.post({
  text: 'Hello from the AT Protocol!',
  createdAt: new Date().toISOString()
})

// Get your timeline
const timeline = await agent.getTimeline({ limit: 50 })

// Get a user profile
const profile = await agent.getProfile({ actor: 'alice.bsky.social' })
4

Explore advanced features

The AT Protocol SDK includes powerful features for building social applications:
  • Rich text with mentions and links
  • Moderation system for content filtering
  • Identity resolution with DIDs and handles
  • Repository management for data storage
  • OAuth support for secure authentication
Check out the guides to learn more.

Explore the SDK

Discover the packages and tools available in the AT Protocol SDK

Client library

Complete API client with TypeScript types, validation, and session management

Identity

DID and handle resolution for decentralized identity

Lexicons

Schema definition language for APIs and data structures

OAuth

OAuth 2.0 client and provider for secure authentication

Rich text

Handle mentions, links, and formatting in posts

Moderation

Content moderation system with labels and filters

Core concepts

Understand the fundamental building blocks of the AT Protocol

Protocol overview

Learn about the architecture and design principles of the AT Protocol

Decentralized identity

Understand DIDs, handles, and identity resolution

Data repositories

Explore signed data repositories and Merkle search trees

Authentication

OAuth flows and session management for secure access

Ready to build?

Start building decentralized social applications with the AT Protocol. Follow the quickstart guide to create your first application.

Start building